ersalil commented on issue #53135:
URL: https://github.com/apache/airflow/issues/53135#issuecomment-3178706767

   I was able to work around the issue by overriding the default template in 
SmtpNotifier and providing a custom html_content.
   
   Here’s an example snippet you can add to your DAG:
   ```
   # Custom SMTP notifier
   failure_notifier = SmtpNotifier(
       to=["[email protected]"],
       subject="Airflow Task Failed: {{ ti.task_id }} in DAG {{ ti.dag_id }}",
       html_content="""
           <h3>Airflow Task Failure</h3>
           <p><b>DAG:</b> {{ ti.dag_id }}</p>
           <p><b>Task:</b> {{ ti.task_id }}</p>
           <p><b>Execution Date:</b> {{ ts }}</p>
           <p><b>Log URL:</b> <a href="{{ ti.log_url }}">{{ ti.log_url 
}}</a></p>
       """
   )
   ```
   Use the notifier in default_args
   ```
   default_args = {
       "on_failure_callback": failure_notifier,
   }
   
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to