Skip to content

EmailOperator is not compatible with the SendGrid backend when hosted on MWAA. #19594

Description

@Nazarii

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?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions