|
|
|
@ -7,9 +7,9 @@ from project.celery import app |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.task |
|
|
|
@app.task |
|
|
|
def send_email(subject, to_email, template_name, **kwargs): |
|
|
|
def send_email(subject, to_email, template_name, attachments=[], **kwargs): |
|
|
|
html = get_template(template_name).render(kwargs) |
|
|
|
html = get_template(template_name).render(kwargs) |
|
|
|
email = EmailMessage(subject, html, to=[to_email]) |
|
|
|
email = EmailMessage(subject, html, to=[to_email], attachments=attachments) |
|
|
|
email.content_subtype = 'html' |
|
|
|
email.content_subtype = 'html' |
|
|
|
email.send() |
|
|
|
email.send() |
|
|
|
|
|
|
|
|
|
|
|
|