diff --git a/providers/smtp/src/airflow/providers/smtp/notifications/templates/email_content.jinja2 b/providers/smtp/src/airflow/providers/smtp/notifications/templates/email_content.jinja2 new file mode 100644 index 0000000000000..8851afbf22892 --- /dev/null +++ b/providers/smtp/src/airflow/providers/smtp/notifications/templates/email_content.jinja2 @@ -0,0 +1,134 @@ +{# + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +#} + + + + + + Airflow Notification + + + +
+ + {% if ti is defined %} +
+

⚠ Task Failure Alert

+

{{ ti.dag_id }} › {{ ti.task_id }}

+
+
+

Task Details

+
+
+
DAG
+
{{ ti.dag_id }}
+
+
+
Task
+
{{ ti.task_id }}
+
+
+
Run ID
+
{{ ti.run_id }}
+
+
+
Attempt
+
{{ ti.try_number }} of {{ ti.max_tries + 1 }}
+
+
+
State
+
{{ ti.state }}
+
+
+
Host
+
{{ ti.hostname }}
+
+
+ +
+ {% if ti.log_url %} + View Log + {% endif %} + {% if ti.mark_success_url is defined and ti.mark_success_url %} + Mark Success + {% endif %} +
+
+ + {% elif slas is defined %} +
+

⌛ SLA Missed

+

{{ dag.dag_id }}

+
+
+

SLA Details

+
+
+
DAG
+
{{ dag.dag_id }}
+
+
+
Tasks
+
{{ task_list }}
+
+
+
Blocking Tasks
+
{{ blocking_task_list }}
+
+
+ +

SLA Misses

+
+
{{ slas }}
+
+ +

Blocking Task Instances

+
+
{{ blocking_tis }}
+
+
+ {% endif %} + + +
+ + diff --git a/providers/smtp/src/airflow/providers/smtp/notifications/templates/email_subject.jinja2 b/providers/smtp/src/airflow/providers/smtp/notifications/templates/email_subject.jinja2 index a9a7869847779..98e268e480622 100644 --- a/providers/smtp/src/airflow/providers/smtp/notifications/templates/email_subject.jinja2 +++ b/providers/smtp/src/airflow/providers/smtp/notifications/templates/email_subject.jinja2 @@ -6,9 +6,7 @@ to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -17,7 +15,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] Task Failed: {{ ti.dag_id }}.{{ ti.task_id }} | Run: {{ ti.run_id }} {% elif slas is defined %} -SLA Missed for DAG {{ dag.dag_id }} - Task {{ slas[0].task_id }} +[Airflow] SLA Missed: {{ dag.dag_id }}.{{ slas[0].task_id }} {% endif %}