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.
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.Configure SendGrid specific environment variables at all Airflow instances: