Custom HTML template is not working on Airflow

Viewed 18

Am trying to use a custom body template for the alert emails on airflow. Have created a file with the below message for testing purpose and mapped the file path to the variable html_content_template in the airflow.cfg file

Try {{try_number}} out of {{max_tries + 1}}<br>
Exception:<br>{{exception_html}}<br>
Log: <a href="{{ti.log_url}}">Link</a><br>
Host: ***.***.***.***<br> Use this ip address as hostname instead of localhost to check 
for logs and change status.
Mark success: <a href="{{ti.mark_success_url}}">Link</a><br>

Another issue, from_email config is also not working when have given a custom email address to send.

Airflow Version: 2.2.5
Ubuntu: 20.x
email_backend = airflow.utils.email.send_email_smtp

0 Answers
Related