You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
313 B
9 lines
313 B
from django.core.mail import EmailMessage
|
|
from django.template.loader import get_template
|
|
|
|
|
|
def send_email(subject, to_email, template_name, **kwargs):
|
|
html = get_template(template_name).render(kwargs)
|
|
email = EmailMessage(subject, html, to=[to_email])
|
|
email.content_subtype = 'html'
|
|
email.send()
|
|
|