Email Configuration¶
You can configure the email that is being sent in your airflow.cfg
by setting a subject_template
and/or a html_content_template
in the [email]
section.
To configure SMTP credentials, create a connection called smtp_default
, or
choose a custom connection name and set it in email_conn_id
.
If you want to check which email backend is currently set, you can use airflow config get-value email email_backend
command as in
the example below.
To access the task's information you use Jinja Templating in your template files.
For example a html_content_template
file could look like this:
Note
For more information on setting the configuration, see Setting Configuration Options
Send email using SendGrid¶
Airflow can be configured to send e-mail using SendGrid.
Follow the steps below to enable it:
Include
sendgrid
subpackage as part of your Airflow installation, e.g.,
Update
email_backend
property in[email]
section inairflow.cfg
, i.e.Create a connection called
sendgrid_default
, or choose a custom connection name and set it inemail_conn_id
.
Send email using AWS SES¶
Airflow can be configured to send e-mail using AWS SES.
Follow the steps below to enable it:
Include
amazon
subpackage as part of your Airflow installation:
Update
email_backend
property in[email]
section inairflow.cfg
:Create a connection called
aws_default
, or choose a custom connection name and set it inemail_conn_id
.