0

We have email notifications set up for Airflow. When a dag fails, we get an email alert but the email from is set to : airflow@mycompany.com

We would like to modify the reply-to in these cases to be person@mycompany.com. Is this possible?

Note, we are not using EmailOperator or any user-defined send_email/oncallback functions, just the built-in alerting. It seems EmailOperator, you can pass in "custom_headers" with reply-to argument (link) but we are not using emailoperator.

Airflow 2.2.5

Gabe
  • 5,113
  • 11
  • 55
  • 88

1 Answers1

0

Per this discussion: https://github.com/apache/airflow/discussions/30684

Write a Python function that wraps for send_email_smtp and handles custom headers and then reference it in config file here.

# Configuration email backend and whether to
# send email alerts on retry or failure
# Email backend to use
email_backend = airflow.utils.email.send_email_smtp

https://github.com/apache/airflow/blob/main/airflow/utils/email.py

I've not implemented yet but that seems to be the approach.

See also SendGrid's email implementation:

Gabe
  • 5,113
  • 11
  • 55
  • 88