Esempio n. 1
0
def email_today():
    global secondary
    primary = pagerduty.get_daily_schedule()
    if secondary:
        secondary = pagerduty.get_daily_schedule(secondary)

    email = """Hello,

We wanted to notify you that you're on call today.

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 today", email_list, txt, html)
        #print "Daily Support Schedule Emailed!"
    else:
        #print "Email not sent."
        pass
Esempio n. 2
0
def email_today():
    global secondary
    primary = pagerduty.get_daily_schedule()
    if secondary:
        secondary = pagerduty.get_daily_schedule(secondary)

    email = """Hello,

We wanted to notify you that you're on call today.

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)

    email_list = extract_emails(primary, secondary)

    if bypass_prompts or raw_input('Send email? [y/N] ').lower() == 'y':
        email_msg("You're on call today", email_list, txt, html)
    else:
        pass
Esempio n. 3
0
def generate_page():
    global secondary

    primary = pagerduty.get_daily_schedule()
    if secondary:
        secondary = pagerduty.get_daily_schedule(secondary)

    return """Content-Type: text/html\n
    <link href="pagerduty.css" media="all" rel="stylesheet" type="text/css" />\n%s
    """ % format_results(primary, secondary)
def generate_page():
    global secondary

    primary = pagerduty.get_daily_schedule()
    if secondary:
        secondary = pagerduty.get_daily_schedule(secondary)

    return """Content-Type: text/html\n
    <link href="pagerduty.css" media="all" rel="stylesheet" type="text/css" />\n{0}%s
    <br/>
    <a href="full-schedule.py" target="_blank">Full Schedule</a>
    """ % format_results(primary, secondary)
Esempio n. 5
0
def generate_page():
    global secondary

    primary = pagerduty.get_daily_schedule()
    if secondary:
        secondary = pagerduty.get_daily_schedule(secondary)

    return """Content-Type: text/html\n
    <link href="pagerduty.css" media="all" rel="stylesheet" type="text/css" />\n{0}%s
    <br/>
    <a href="full-schedule.py" target="_blank">Full Schedule</a>
    """ % format_results(primary, secondary)
Esempio n. 6
0
def list_day():
    global secondary
    primary = pagerduty.get_daily_schedule()
    if secondary:
        secondary = pagerduty.get_daily_schedule(secondary)
    print format_results(primary, secondary)
Esempio n. 7
0
def list_day():
    global secondary
    primary = pagerduty.get_daily_schedule()
    if secondary:
        secondary = pagerduty.get_daily_schedule(secondary)
    print format_results(primary, secondary)