コード例 #1
0
def admin_contact_funder(bounty, text, from_user):
    from_email = from_user.email
    to_email = bounty.bounty_owner_email
    if not to_email:
        if bounty.bounty_owner_profile:
            to_email = bounty.bounty_owner_profile.email
    if not to_email:
        if bounty.bounty_owner_profile and bounty.bounty_owner_profile.user:
            to_email = bounty.bounty_owner_profile.user.email
    if not to_email:
        return
    cur_language = translation.get_language()
    try:
        setup_lang(to_email)

        subject = bounty.url
        __, text = render_admin_contact_funder(bounty, text, from_user)
        cc_emails = [from_email]
        if not should_suppress_notification_email(to_email,
                                                  'admin_contact_funder'):
            send_mail(
                from_email,
                to_email,
                subject,
                text,
                cc_emails=cc_emails,
                from_name=from_email,
                categories=['transactional', func_name()],
            )
    finally:
        translation.activate(cur_language)
コード例 #2
0
def admin_contact_funder(bounty, text, from_user):
    from_email = from_user.email
    to_email = bounty.bounty_owner_email
    cur_language = translation.get_language()
    try:
        setup_lang(to_email)

        subject = bounty.url
        html, text = render_admin_contact_funder(bounty, text, from_user)
        cc_emails = [from_email]
        if not should_suppress_notification_email(to_email, 'admin_contact_funder'):
            send_mail(from_email, to_email, subject, text, cc_emails=cc_emails, from_name=from_email)
    finally:
        translation.activate(cur_language)