def send_reminder(email_id,thread,subject,auto_ask,msg_id): sender_id = "*****@*****.**" sender_name = 'Planck Reminders' participants = filter(lambda x:x['email'].lower() != email_id.lower(),thread['participants']) unique_first_name_list = list(set([x['name'] for x in participants])) first_name_list = ', '.join(unique_first_name_list) # send mail to sender receiver_list = json.dumps([{'email':email_id}]) sender_subject = subject sender_body = "Hi, you asked me to remind you, if no replies are received to the thread with subject \""+sender_subject+"\". Please take necessary action<br /><br />Thank you," token_store.send_mail_to_users(sender_id,sender_name,receiver_list,sender_subject,sender_body,'') print "sent mail to the sender" # send mail to receivers if required if(auto_ask == 1): sender_name = email_id sender_id = email_id receiver_list = json.dumps(participants) sender_subject = sender_subject sender_body = 'Hi, This is a gentle reminder that '+sender_name+' is waiting for your reply to the thread with subject "'+sender_subject+'". Please reply at your convenience.\n\nThank you,' #TODO: reply to the same thread token_store.send_mail_to_users(sender_id,sender_name,receiver_list,sender_subject,sender_body,msg_id) print "sent mail to all" return
def send_reminder(email_id, thread, subject, auto_ask, msg_id): sender_id = "*****@*****.**" sender_name = 'Planck Reminders' participants = filter(lambda x: x['email'].lower() != email_id.lower(), thread['participants']) unique_first_name_list = list(set([x['name'] for x in participants])) first_name_list = ', '.join(unique_first_name_list) # send mail to sender receiver_list = json.dumps([{'email': email_id}]) sender_subject = subject sender_body = "Hi, you asked me to remind you, if no replies are received to the thread with subject \"" + sender_subject + "\". Please take necessary action<br /><br />Thank you," token_store.send_mail_to_users(sender_id, sender_name, receiver_list, sender_subject, sender_body, '') print "sent mail to the sender" # send mail to receivers if required if (auto_ask == 1): sender_name = email_id sender_id = email_id receiver_list = json.dumps(participants) sender_subject = sender_subject sender_body = 'Hi, This is a gentle reminder that ' + sender_name + ' is waiting for your reply to the thread with subject "' + sender_subject + '". Please reply at your convenience.\n\nThank you,' #TODO: reply to the same thread token_store.send_mail_to_users(sender_id, sender_name, receiver_list, sender_subject, sender_body, msg_id) print "sent mail to all" return
def send_snooze_reminder(email_id, thread): sender_id = "*****@*****.**" sender_name = "Planck Reminders" participants = filter(lambda x:x['email'].lower() != email_id.lower(),thread['participants']) name_list = [x['name'] for x in participants] names_string = ', '.join(name_list) # send mail to sender receiver_list = json.dumps([{'email':email_id}]) sender_subject = thread['subject'] sender_body = "Hi, you asked me to remind you of the mail which you snoozed with subject \""+sender_subject+"\". It has been moved back from FollowUps. Please take necessary action.<br /><br />Thank you," token_store.send_mail_to_users(sender_id,sender_name,receiver_list,sender_subject,sender_body,'')