Exemplo n.º 1
0
def email_list(request):
    template_data = base_template_data()
    return render_to_response(
        'emails/email_listing_page.html',
        template_data,
        context_instance=RequestContext(request)
    )
Exemplo n.º 2
0
def view_invite(request):
    template_data = base_template_data()
    template_data['invitee'] = '*****@*****.**'
    template_data['code'] = 'TESTCODE_1'
    template_data['email'] = '*****@*****.**'
    return render_to_response(
        'emails/email_templates/invite_01.html',
        template_data
    )
Exemplo n.º 3
0
 def SendInviteEmail(cls, to_user, code, from_user=None):
     template_data = base_template_data()
     template_data['invitee'] = from_user
     subject = 'You have been invited to join DeLv from metaLayer'
     from_email = 'Team Metalayer <*****@*****.**>'
     template_data['code'] = code
     template_data['email'] = to_user
     html = render_to_string(
         'emails/email_templates/invite_01.html',
         template_data
     )
     text = strip_tags(html)
     msg = EmailMultiAlternatives(subject, text, from_email, [to_user])
     msg.attach_alternative(html, "text/html")
     msg.send()
Exemplo n.º 4
0
def test_email(request, email_type, recipient):
    template_data = base_template_data()
    if email_type == 'invite':
        template_data['invitee'] = '*****@*****.**'
        subject = 'You have been invited to join metaLayer'
        from_email = 'Team Metalayer <*****@*****.**>'
        template_data['code'] = 'TESTCODE_1'
        template_data['email'] = '*****@*****.**'
        html = render_to_string(
            'emails/email_templates/invite_01.html',
            template_data
        )
        text = strip_tags(html)
        msg = EmailMultiAlternatives(subject, text, from_email, [recipient])
        msg.attach_alternative(html, "text/html")
        msg.send()
        messages.info(request, 'That email has been sent')
        return redirect(email_list)
    raise Http404