def email_administrators(event, subject, body, html=None, include_local=True):
    admin_orgs = get_event_admins(event) if include_local else get_global_admins()
    admin_contacts = reduce(
        lambda x, y: list(x) + list(y),
        (org.contacts for org in admin_orgs)
    )
    email_contacts(event, admin_contacts, subject, body, html=html)
Exemple #2
0
def email_administrators(event, subject, body, html=None, include_local=True):
    admin_orgs = get_event_admins(event) if include_local else get_global_admins()
    admin_contacts = reduce(
        lambda x, y: list(x) + list(y),
        (org.contacts for org in admin_orgs)
    )
    email_contacts(event, admin_contacts, subject, body, html=html)
Exemple #3
0
def send_activated_emails(org_activated):
    email_contacts_using_templates(
        org_activated.incidents[0],
        org_activated.primary_contacts,
        'activated.subject.txt',
        'activated.body.txt',
        org=org_activated,
        bcc_contacts=get_global_admins()[0].contacts)
def send_activated_emails(org_activated):
    email_contacts_using_templates(
        org_activated.incidents[0],
        org_activated.primary_contacts,
        'activated.subject.txt',
        'activated.body.txt',
        org=org_activated,
        bcc_contacts=get_global_admins()[0].contacts
    )
Exemple #5
0
def send_activation_emails(org_for_activation):
    activation_url = "%s/activate?code=%s" % (
        get_base_url(), org_for_activation.activation_code)
    email_contacts_using_templates(
        None,
        org_for_activation.primary_contacts,
        'activation.subject.txt',
        'activation.body.txt',
        org=org_for_activation,
        activation_url=activation_url,
        bcc_contacts=get_global_admins()[0].contacts)
def send_activation_emails(org_for_activation):
    activation_url = "%s/activate?code=%s" % (
        get_base_url(), org_for_activation.activation_code)
    email_contacts_using_templates(
        None,
        org_for_activation.primary_contacts,
        'activation.subject.txt',
        'activation.body.txt',
        org=org_for_activation,
        activation_url=activation_url,
        bcc_contacts=get_global_admins()[0].contacts
    )
Exemple #7
0
def email_administrators_using_templates(event,
                                         subject_template_name,
                                         body_template_name,
                                         include_local=True,
                                         **kwargs):
    """
    Email all relevant administrators for event, using Jinja2 templates.
    """
    admin_orgs = get_event_admins(
        event) if include_local else get_global_admins()
    admin_contacts = reduce(lambda x, y: list(x) + list(y),
                            (org.contacts for org in admin_orgs))
    email_contacts_using_templates(event, admin_contacts,
                                   subject_template_name, body_template_name,
                                   **kwargs)
def email_administrators_using_templates(
    event, subject_template_name, body_template_name, include_local=True, **kwargs):
    """
    Email all relevant administrators for event, using Jinja2 templates.
    """
    admin_orgs = get_event_admins(event) if include_local else get_global_admins()
    admin_contacts = reduce(
        lambda x, y: list(x) + list(y),
        (org.contacts for org in admin_orgs)
    )
    email_contacts_using_templates(
        event,
        admin_contacts,
        subject_template_name,
        body_template_name,
        **kwargs
    )