django-templated-email
django-templated-email copied to clipboard
from_email should accept None and set DEFAULT_FROM_EMAIL in that case
What do you think @aericson ?
I believe the idea here was to mimic as close as possible the arguments of django.core.mail.send_mail
If we decide to change, what would be the correct approach to do this while keeping the backward compatibility and args order?
Leave all other required arguments with None
default and manually raise ValueError
if they are None
?
On a side note: Because of Django's EmailMessage
, even though it's not ideal, if you pass None
as a from_email
it will fall back to use the DEFAULT_FROM_EMAIL
. [1]
Yes, the idea is to mimic Django behavior. But if we're going to lose backward compatibility for arg order, then don't worry.
We should only have a test to ensure from_email=None
falls back to DEFAULT_FROM_EMAIL
Am I understanding this correctly: if settings.TEMPLATED_EMAIL_FROM_EMAIL
is not set, then, because of Django, it will fall back to DEFAULT_FROM_EMAIL
? From the documentation, I was under the impression that TEMPLATED_EMAIL_FROM_EMAIL
was a required setting if you did not specify from_email
... It may just be a silly assumption on my part, do you think it's worth clarifying in the docs?