| 14982 |
amit.gupta |
1 |
'''
|
|
|
2 |
Created on Apr 26, 2015
|
|
|
3 |
|
|
|
4 |
@author: amit
|
|
|
5 |
'''
|
|
|
6 |
from dtr.storage.Mongo import get_mongo_connection
|
|
|
7 |
from dtr.utils.utils import sendNotification
|
|
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
def sendAmazonNotificationsToUsersWithMissingOrderDetails():
|
|
|
12 |
db = get_mongo_connection().Dtr
|
|
|
13 |
userIds = []
|
|
|
14 |
orders = db.merchantOrder.find({'status':'html_required', 'storeId':1, 'subOrders':{'$exists':0}})
|
|
|
15 |
for o in orders:
|
|
|
16 |
if o['userId'] not in userIds:
|
|
|
17 |
print o['userId'], o['orderSuccessUrl']
|
|
|
18 |
sendNotification([o['userId']], 'Test', 'Claim cashback on your Amazon orders', 'Login to your Amazon account now.', 'url', o['orderSuccessUrl'])
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
|
22 |
def main():
|
|
|
23 |
sendAmazonNotificationsToUsersWithMissingOrderDetails()
|
|
|
24 |
|
|
|
25 |
if __name__=='__main__':
|
|
|
26 |
main()
|