コード例 #1
0
def send_change_email_success(request, action):

    subject = render_to_string(
        template_name="users/email/change_email_subject.txt", context=None)
    text_body = render_to_string(
        template_name="users/email/change_email_body.txt",
        context=make_context(request, action))
    html_body = render_to_string(
        template_name="users/email/change_email_body.html",
        context=make_context(request, action))

    send_email(subject, [action.user.email], text_body, html_body)
コード例 #2
0
def change_email_realized(request, action):
    hostname = get_hostname(request)
    context = RequestContext(request=request)

    subject = render_to_string(
        template_name="users/email/change_email_success_subject.txt",
        context=None)
    text_body = render_to_string(
        template_name="users/email/change_email_success_body.txt",
        context=context)
    html_body = render_to_string(
        template_name="users/email/change_email_success_body.html",
        context=context)

    send_email(subject, [action.user.email], text_body, html_body)
コード例 #3
0
def send_cancel_account(request, action):
    path = reverse("users:view-cancel-account", kwargs={"token": action.token})
    hostname = get_hostname(request)
    data = dict()
    data["user"] = action.user
    data["action_url"] = hostname + path
    context = RequestContext(request=request, dict_=data)

    subject = render_to_string(
        template_name="users/email/cancel_account_subject.txt", context=None)
    text_body = render_to_string(
        template_name="users/email/cancel_account_body.txt", context=context)
    html_body = render_to_string(
        template_name="users/email/cancel_account_body.html", context=context)

    send_email(subject, [action.user.email], text_body, html_body)
コード例 #4
0
def send_welcome(request, action):
    hostname = get_hostname(request)
    data = dict()
    data["action_url"] = hostname
    context = RequestContext(request=request, dict_=data)

    subject = render_to_string(
        template_name="credentials/email/account_welcome_subject.txt",
        context=None)
    text_body = render_to_string(
        template_name="credentials/email/account_welcome_message.txt",
        context=context)
    html_body = render_to_string(
        template_name="credentials/email/account_welcome_message.html",
        context=context)

    send_email(subject, [action.user.email], text_body, html_body)
コード例 #5
0
def send_reset_password(request, action):
    path = reverse("credentials:reset-password",
                   kwargs={"token": action.token})
    hostname = get_hostname(request)
    data = dict()
    data["user"] = action.user
    data["password_reset_url"] = hostname + path
    context = RequestContext(request=request, dict_=data)

    subject = render_to_string(
        template_name="account/email/password_reset_key_subject.txt",
        context=None)
    text_body = render_to_string(
        template_name="account/email/password_reset_key_message.txt",
        context=context)
    html_body = render_to_string(
        template_name="account/email/password_reset_key_message.html",
        context=context)

    send_email(subject, [action.user.email], text_body, html_body)
コード例 #6
0
def send_change_email(request, action):
    path = reverse("change-email", kwargs={"token": action.token})
    subject = render_to_string(
        template_name="users/email/change_email_subject.txt", context=None)
    text_body = render_to_string(
        template_name="users/email/change_email_body.txt",
        context=make_context(
            request=request,
            user=action.user,
            path=path,
        ))
    html_body = render_to_string(
        template_name="users/email/change_email_body.html",
        context=make_context(
            request=request,
            user=action.user,
            path=path,
        ))

    send_email(subject, [action.user.email], text_body, html_body)