コード例 #1
0
def _send_mail_to_user(user, subject, templateName, contextData, whentrue):
    if (user.getUserInfo()
            and (not whentrue or getattr(user.getUserInfo(), whentrue))):
        template = get_template(templateName)
        context = Context(contextData)
        html_content = template.render(context)
        send_html_mail(subject, html_content, html_content,
                       settings.DEFAULT_FROM_EMAIL, [user.email])
コード例 #2
0
def plain_send_mail(to, subject, body, from_email=settings.DEFAULT_FROM_EMAIL):
    send_html_mail(subject, body, body, from_email, [to])
コード例 #3
0
def notify_admin(subject, msg):
    send_html_mail(subject, msg, msg, settings.DEFAULT_FROM_EMAIL, ADMINS_EMAILS)
コード例 #4
0
def _send_mail_to_user(user, subject, templateName, contextData, whentrue):
    if(user.getUserInfo() and (not whentrue or getattr(user.getUserInfo(), whentrue))):
        template = get_template(templateName)
        context = Context(contextData)
        html_content = template.render(context)
        send_html_mail(subject, html_content, html_content, settings.DEFAULT_FROM_EMAIL, [user.email])
コード例 #5
0
def notify_admin(subject, msg):
    send_html_mail(subject, msg, msg, settings.DEFAULT_FROM_EMAIL,
                   ADMINS_EMAILS)
コード例 #6
0
def plain_send_mail(to, subject, body, from_email=settings.DEFAULT_FROM_EMAIL):
    send_html_mail(subject, body, body, from_email, [to])
コード例 #7
0
def plain_send_mail(to, subject, body):
    send_html_mail(subject, body, body, settings.DEFAULT_FROM_EMAIL, [to])
コード例 #8
0
def _send_mail_to_user(user, subject, templateName, contextData):
    if(user.getUserInfo() and user.getUserInfo().receiveAllEmail):
        template = get_template(templateName)
        context = Context(contextData)
        html_content = template.render(context)
        send_html_mail(subject, html_content, html_content, settings.DEFAULT_FROM_EMAIL, [user.email])