Skip to content

do not send if empty email address #52

Open
@brunobord

Description

@brunobord

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions