Rev 14982 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
'''Created on Apr 26, 2015@author: amit'''from dtr.storage.Mongo import get_mongo_connectionfrom dtr.utils.utils import sendNotificationdef sendAmazonNotificationsToUsersWithMissingOrderDetails():db = get_mongo_connection().DtruserIds = []orders = db.merchantOrder.find({'status':'html_required', 'storeId':1, 'subOrders':{'$exists':0}})for o in orders:if o['userId'] not in userIds:print o['userId'], o['orderSuccessUrl']o.append(o['userId'])sendNotification([o['userId']], 'Test', 'Claim cashback on your Amazon orders', 'Login to your Amazon account now.', 'url', o['orderSuccessUrl'])def main():sendAmazonNotificationsToUsersWithMissingOrderDetails()if __name__=='__main__':main()