Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not send if empty email address #52

Open
brunobord opened this issue Oct 23, 2014 · 1 comment
Open

do not send if empty email address #52

brunobord opened this issue Oct 23, 2014 · 1 comment
Labels

Comments

@brunobord
Copy link

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?

@Natim
Copy link
Collaborator

Natim commented Oct 23, 2014

Yes if the EMAIL_BACKEND doesn't raise then we should probably raise before in mail_factory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants