diff --git a/airflow/providers/smtp/notifications/smtp.py b/airflow/providers/smtp/notifications/smtp.py index cf7d3ab2d52c0..b7138f4141172 100644 --- a/airflow/providers/smtp/notifications/smtp.py +++ b/airflow/providers/smtp/notifications/smtp.py @@ -33,7 +33,7 @@ SMTP_DEFAULT_TEMPLATED_SUBJECT_PATH = conf.get( "smtp", "templated_email_subject_path", - fallback=(Path(__file__).parent / "templates" / "email_subject.jinja").as_posix(), + fallback=(Path(__file__).parent / "templates" / "email_subject.jinja2").as_posix(), ) diff --git a/airflow/providers/smtp/notifications/templates/email_subject.jinja b/airflow/providers/smtp/notifications/templates/email_subject.jinja deleted file mode 100644 index 053d15abb36ff..0000000000000 --- a/airflow/providers/smtp/notifications/templates/email_subject.jinja +++ /dev/null @@ -1,5 +0,0 @@ -{% if ti is defined %} -DAG {{ ti.dag_id }} - Task {{ ti.task_id }} - Run ID {{ ti.run_id }} in State {{ ti.state }} -{% elif slas is defined %} -SLA Missed for DAG {{ dag.dag_id }} - Task {{ slas[0].task_id }} -{% endif %} diff --git a/airflow/providers/smtp/notifications/templates/email_subject.jinja2 b/airflow/providers/smtp/notifications/templates/email_subject.jinja2 new file mode 100644 index 0000000000000..a9a7869847779 --- /dev/null +++ b/airflow/providers/smtp/notifications/templates/email_subject.jinja2 @@ -0,0 +1,23 @@ +{# + 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. +#} +{% if ti is defined %} +DAG {{ ti.dag_id }} - Task {{ ti.task_id }} - Run ID {{ ti.run_id }} in State {{ ti.state }} +{% elif slas is defined %} +SLA Missed for DAG {{ dag.dag_id }} - Task {{ slas[0].task_id }} +{% endif %}