You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure that this should belong here, but here's the use case:
for some reason in our of our project, we're looping over a list of persons, and sometimes these accounts have an email address and sometimes they don't (it's not a bug, it's a feature).
when we're trying to send emails using this empty to argument, things can break in the background.
Of course, the "poor man's" fix is to parse every occurrence of mail_factory.send() and prevent the sending if the email is empty.
But I was wondering if it was not more DRY to add this check in this "central" library.
IMHO, it's stupid to try to send an email to an empty email address.
But I'm not sure it would be the place to put it here, or in the EMAIL_BACKEND. But I'd rather try to reject (raise Exception? log and drop the sending?) in a common library, that is to say the mail_factory bit.
What do you think?
The text was updated successfully, but these errors were encountered:
I'm not sure that this should belong here, but here's the use case:
for some reason in our of our project, we're looping over a list of persons, and sometimes these accounts have an email address and sometimes they don't (it's not a bug, it's a feature).
when we're trying to send emails using this empty
to
argument, things can break in the background.Of course, the "poor man's" fix is to parse every occurrence of mail_factory.send() and prevent the sending if the email is empty.
But I was wondering if it was not more DRY to add this check in this "central" library.
IMHO, it's stupid to try to send an email to an empty email address.
But I'm not sure it would be the place to put it here, or in the EMAIL_BACKEND. But I'd rather try to reject (raise Exception? log and drop the sending?) in a common library, that is to say the mail_factory bit.
What do you think?
The text was updated successfully, but these errors were encountered: