Correct Django template example

Fixes #60.
This commit is contained in:
Mike Edmunds
2014-03-08 10:40:55 -08:00
parent 1707e2a665
commit 956e45bfcb

View File

@@ -63,8 +63,8 @@ Example that builds an email from the templates ``message_subject.txt``,
text_body = render_to_string("message_body.txt", template_data, plaintext_context) text_body = render_to_string("message_body.txt", template_data, plaintext_context)
html_body = render_to_string("message_body.html", template_data) html_body = render_to_string("message_body.html", template_data)
msg = EmailMessage(subject=subject, from_email="store@example.com", msg = EmailMultiAlternatives(subject=subject, from_email="store@example.com",
to=["customer@example.com"], body=text_body) to=["customer@example.com"], body=text_body)
msg.attach_alternative(html_body, "text/html") msg.attach_alternative(html_body, "text/html")
msg.send() msg.send()