diff --git a/airflow-core/docs/howto/email-config.rst b/airflow-core/docs/howto/email-config.rst index c3373447654d7..2b725c7c8cd5d 100644 --- a/airflow-core/docs/howto/email-config.rst +++ b/airflow-core/docs/howto/email-config.rst @@ -25,7 +25,6 @@ in the ``[email]`` section. .. code-block:: ini [email] - email_backend = airflow.utils.email.send_email_smtp subject_template = /path/to/my_subject_template_file html_content_template = /path/to/my_html_content_template_file @@ -33,7 +32,6 @@ Equivalent environment variables look like: .. code-block:: sh - AIRFLOW__EMAIL__EMAIL_BACKEND=airflow.utils.email.send_email_smtp AIRFLOW__EMAIL__SUBJECT_TEMPLATE=/path/to/my_subject_template_file AIRFLOW__EMAIL__HTML_CONTENT_TEMPLATE=/path/to/my_html_content_template_file @@ -57,14 +55,6 @@ connection called ``smtp_default`` of ``Email`` type, or choose a custom connect the configuration & store SMTP username-password in it. Other SMTP settings like host, port etc always gets picked up from the configuration only. The connection can be of any type (for example 'HTTP connection'). -If you want to check which email backend is currently set, you can use ``airflow config get-value email email_backend`` command as in -the example below. - -.. code-block:: bash - - $ airflow config get-value email email_backend - airflow.utils.email.send_email_smtp - To access the task's information you use `Jinja Templating `_ in your template files. For example a ``html_content_template`` file could look like this: diff --git a/airflow-core/src/airflow/cli/commands/config_command.py b/airflow-core/src/airflow/cli/commands/config_command.py index 211372e0c606f..7e6c913f6d9a3 100644 --- a/airflow-core/src/airflow/cli/commands/config_command.py +++ b/airflow-core/src/airflow/cli/commands/config_command.py @@ -818,12 +818,6 @@ def message(self) -> str | None: config=ConfigParameter("triggerer", "default_capacity"), renamed_to=ConfigParameter("triggerer", "capacity"), ), - # email - ConfigChange( - config=ConfigParameter("email", "email_backend"), - was_removed=True, - remove_if_equals="airflow.contrib.utils.sendgrid.send_email", - ), # elasticsearch ConfigChange( config=ConfigParameter("elasticsearch", "log_id_template"), diff --git a/airflow-core/src/airflow/config_templates/config.yml b/airflow-core/src/airflow/config_templates/config.yml index 4b44ce6c181e6..c9190889cfe7b 100644 --- a/airflow-core/src/airflow/config_templates/config.yml +++ b/airflow-core/src/airflow/config_templates/config.yml @@ -2192,6 +2192,10 @@ email: email_backend: description: Email backend to use version_added: ~ + version_deprecated: 3.2.0 + deprecation_reason: | + Since the legacy email_on_failure and email_on_retry attributes are replaced with SmtpNotifier + from apache-airflow-providers-smtp, email_backend is no longer used. type: string example: ~ default: "airflow.utils.email.send_email_smtp" diff --git a/airflow-ctl/src/airflowctl/ctl/commands/config_command.py b/airflow-ctl/src/airflowctl/ctl/commands/config_command.py index b4cb9725ca8be..44ebb4eec8342 100644 --- a/airflow-ctl/src/airflowctl/ctl/commands/config_command.py +++ b/airflow-ctl/src/airflowctl/ctl/commands/config_command.py @@ -700,12 +700,6 @@ def _get_option_value(self, config_resp: Config) -> str | None: renamed_to=ConfigParameter("triggerer", "capacity"), breaking=True, ), - # email - ConfigChange( - config=ConfigParameter("email", "email_backend"), - was_removed=True, - remove_if_equals="airflow.contrib.utils.sendgrid.send_email", - ), # elasticsearch ConfigChange( config=ConfigParameter("elasticsearch", "log_id_template"),