|
@@ -47,9 +47,11 @@ def ldap_hash(password):
|
|
|
return password
|
|
|
|
|
|
|
|
|
-def send_templated_email(to, subject_template, body_template, context={}, attachements=[]):
|
|
|
+def send_templated_email(to, subject_template, body_template, context={}, attachements=[], **kwargs):
|
|
|
"""
|
|
|
Send a multialternative email based on html and optional txt template.
|
|
|
+
|
|
|
+ :param **kwargs: extra-args pased as-is to EmailMultiAlternatives()
|
|
|
"""
|
|
|
|
|
|
# Ensure arrays when needed
|
|
@@ -84,7 +86,7 @@ def send_templated_email(to, subject_template, body_template, context={}, attach
|
|
|
text_content = html2text.html2text(html_content)
|
|
|
|
|
|
# make multipart email default : text, alternative : html
|
|
|
- msg = EmailMultiAlternatives(subject=subject, body=text_content, to=to)
|
|
|
+ msg = EmailMultiAlternatives(subject=subject, body=text_content, to=to, **kwargs)
|
|
|
msg.attach_alternative(html_content, "text/html")
|
|
|
|
|
|
# Set attachements
|