flask-mail
flask-mail copied to clipboard
MAIL_DEFAULT_SENDER setting is required even when 'MAIL_SUPRESS_SEND = True'
This issue was made after configuring some test environments at NYCPython for PyGotham and it felt unnecessary to set 2 default settings in order for our create_admin command to work. After actually looking around the code, it feels like there are rarely places where this is the case. I think instead we should have just set SEND_REGISTER_EMAIL = False, since that is actually what we want. I am considering closing this issue
@djds23 keep in mind that there are other types of emails that are sent in the PyGotham application. Turning off one doesn't solve the problem, it just moves it.
@mattupstate without knowing more, my initial thinking was that MAIL_SUPPRESS_SEND would just bypass the send. I was surprised when it checked for MAIL_DEFAULT_SENDER. Is the idea of MAIL_SUPPRESS_SEND that it gets as close to sending the email as possible without actually sending it?
@dirn Correct. The only thing MAIL_SUPPRESS_SEND prevents is connecting to the email server. Otherwise everything behaves the same. This is to create the least amount of side-effects as possible. Thus the error that @djds23 is reporting is to be expected.
Suppressing sending isn't the same as not creating the message objects.