def email_week(): global secondary primary = pagerduty.get_weekly_schedule() if secondary: secondary = pagerduty.get_weekly_schedule(secondary) email = """Hello Team, Below is the Pager Duty schedule for next week. If you cannot fulfill your duty, please notify your backup immediately. It is vital for you to communicate this with your teammate. %s Thanks, The Support Team """ txt = email % format_results(primary, secondary) html = email.replace('\n', '<br>\n') % format_results(primary, secondary, html=True) email_list = extract_emails(primary, secondary) if bypass_prompts or raw_input('Send email? [y/N] ').lower() == 'y': email_msg("You're on call next week", email_list, txt, html) else: pass
def email_week(): global secondary primary = pagerduty.get_weekly_schedule() if secondary: secondary = pagerduty.get_weekly_schedule(secondary) email = """Hello Team, Below is the Pager Duty schedule for this week. Once again, the Support Team appreciates your contributions. However, if you cannot fulfill your duty, please notify your backup immediately. It is vital for you to communicate this with your teammate. %s Thanks, The Support Team """ txt = email % format_results(primary, secondary) html = email.replace('\n', '<br>\n') % format_results(primary, secondary, html=True) print txt email_list = extract_emails(primary, secondary) print 'Email list: %s' % email_list if bypass_prompts or raw_input('Send email? [y/N] ').lower() == 'y': email_msg("You're on call this week", email_list, txt, html) print "Weekly Support Schedule Emailed!" else: print "Email not sent."
def email_week(): global secondary primary = pagerduty.get_weekly_schedule() if secondary: secondary = pagerduty.get_weekly_schedule(secondary) email = """Hello Team, Below is the Pager Duty schedule for this week. Once again, the Support Team appreciates your contributions. However, if you cannot fulfill your duty, please notify your backup immediately. It is vital for you to communicate this with your teammate. %s Thanks, The Support Team """ txt = email % format_results(primary, secondary) html = email.replace('\n', '<br>\n') % format_results( primary, secondary, html=True) #print txt email_list = extract_emails(primary, secondary) #print 'Email list: %s' % email_list if bypass_prompts or raw_input('Send email? [y/N] ').lower() == 'y': email_msg("You're on call this week", email_list, txt, html) #print "Weekly Support Schedule Emailed!" else: #print "Email not sent." pass
def email_week(): global secondary primary = pagerduty.get_weekly_schedule() if secondary: secondary = pagerduty.get_weekly_schedule(secondary) email = """Hello Team, Below is the Pager Duty schedule for next week. If you cannot fulfill your duty, please notify your backup immediately. It is vital for you to communicate this with your teammate. %s Thanks, The Support Team """ txt = email % format_results(primary, secondary) html = email.replace('\n', '<br>\n') % format_results( primary, secondary, html=True) email_list = extract_emails(primary, secondary) if bypass_prompts or raw_input('Send email? [y/N] ').lower() == 'y': email_msg("You're on call next week", email_list, txt, html) else: pass
def list_week(): global secondary primary = pagerduty.get_weekly_schedule() if secondary: secondary = pagerduty.get_weekly_schedule(secondary) print format_results(primary, secondary)