hussein-awala commented on code in PR #67931:
URL: https://github.com/apache/airflow/pull/67931#discussion_r4754983312


##########
providers/smtp/src/airflow/providers/smtp/notifications/templates/email.html:
##########
@@ -4,57 +4,97 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
         <meta name="viewport" content="width=device-width">
     </head>
-<body>
-    <table role="presentation">
-        {% if ti is defined %}
+<body 
style="margin:0;padding:0;background-color:#f4f4f5;font-family:-apple-system,BlinkMacSystemFont,'Segoe
 UI',Roboto,Helvetica,Arial,sans-serif;color:#1f2937;">
+    <table role="presentation" width="100%" cellpadding="0" cellspacing="0" 
border="0" style="background-color:#f4f4f5;padding:24px 0;">
         <tr>
-            <td>Run ID:</td>
-            <td>{{ ti.run_id }}</td>
+            <td align="center">
+                <table role="presentation" width="600" cellpadding="0" 
cellspacing="0" border="0" 
style="max-width:600px;width:100%;background-color:#ffffff;border:1px solid 
#e5e7eb;border-radius:6px;">
+                    {% if ti is defined %}
+                    <tr>
+                        <td style="padding:16px 
24px;background-color:#dc2626;color:#ffffff;font-size:18px;font-weight:bold;border-top-left-radius:6px;border-top-right-radius:6px;">
+                            Airflow Task Failed

Review Comment:
   This still renders “Airflow Task Failed” on success and retry callbacks 
because the heading only checks whether `ti` is present. Could you make the 
heading state-aware or use a neutral heading? Please add a test that renders 
the default HTML for a non-failure state and checks that it includes the Dag 
and task IDs.
   
   ---
   Drafted-by: Codex (GPT-6); reviewed by @hussein-awala before posting



##########
providers/smtp/src/airflow/providers/smtp/notifications/templates/email_subject.jinja2:
##########
@@ -17,7 +17,7 @@
  under the License.
 #}
 {% if ti is defined %}
-DAG {{ ti.dag_id }} - Task {{ ti.task_id }} - Run ID {{ ti.run_id }} in State 
{{ ti.state }}
+[Airflow] {{ ti.dag_id }}.{{ ti.task_id }} {{ ti.state }} - Run {{ ti.run_id }}

Review Comment:
   Airflow’s `email_on_failure` path supplies its own subject and body to 
`SmtpNotifier`, so it bypasses these templates. Its default subject still 
renders `Airflow alert: {{ti}}`, which is the object dump reported in #61667. 
If this PR stays scoped to the notifier templates, could you remove `Resolves 
#61667` and leave that issue open? #73221 covers both email paths.
   
   ---
   Drafted-by: Codex (GPT-6); reviewed by @hussein-awala before posting



-- 
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