Exemple #1
0
def mail_target_participants(participant_cls, target, subject,
                             excluded_emails=[], template=None, **kwargs):
    """Send a message to participants of a given target."""
    participants = participant_cls.objects.filter(
        content_type=ContentType.objects.get_for_model(target),
        object_id=target.pk,
    )
    participants = [p for p in participants if p.email not in excluded_emails]
    messages = _get_messages(participants, template, **kwargs)
    mail_multiple_personalized(subject, messages,
                               from_email=get_target_email_address(target))
Exemple #2
0
def mail_facilitators(target, subject, excluded_emails=[],
                      template='organize/notifications/facilitators_text.txt',
                      **kwargs):
    """Sends a message to facilitators."""
    facilitators = settings.FACILITATORS['global']
    facilitators = [f for f in facilitators if f not in excluded_emails]

    messages = _get_facilitator_messages(facilitators, target, template,
                                         **kwargs)
    mail_multiple_personalized(subject, messages, fail_silently=False,
                               from_email=get_target_email_address(target))
Exemple #3
0
def mail_facilitators(target,
                      subject,
                      excluded_emails=[],
                      template='organize/notifications/facilitators_text.txt',
                      **kwargs):
    """Sends a message to facilitators."""
    facilitators = settings.FACILITATORS['global']
    facilitators = [f for f in facilitators if f not in excluded_emails]

    messages = _get_facilitator_messages(facilitators, target, template,
                                         **kwargs)
    mail_multiple_personalized(subject,
                               messages,
                               fail_silently=False,
                               from_email=get_target_email_address(target))