Description
Modify the SendGrid to use from_email from the AIRFLOW__SMTP__SMTP_MAIL_FROM section.
Use case/motivation
When we use the EmailOperator we can not specify the email_from param.
When using the email_backend = airflow.providers.sendgrid.utils.emailer.send_email it is impossible to send the email on the MWAA since SendGrid policy requires to specify the sender email address. Sender email address can be taken from the global var SENDGRID_MAIL_FROM which is impossible to set in the MWAA. We need to use global AIRFLOW__SMTP__SMTP_MAIL_FROM section as the last chance to determine the sender email.
Related issues
No response
Are you willing to submit a PR?
Code of Conduct
Description
Modify the SendGrid to use
from_emailfrom theAIRFLOW__SMTP__SMTP_MAIL_FROMsection.Use case/motivation
When we use the
EmailOperatorwe can not specify theemail_fromparam.When using the
email_backend = airflow.providers.sendgrid.utils.emailer.send_emailit is impossible to send the email on the MWAA since SendGrid policy requires to specify the sender email address. Sender email address can be taken from the global varSENDGRID_MAIL_FROMwhich is impossible to set in the MWAA. We need to use globalAIRFLOW__SMTP__SMTP_MAIL_FROMsection as the last chance to determine the sender email.Related issues
No response
Are you willing to submit a PR?
Code of Conduct