diff --git a/providers/smtp/src/airflow/providers/smtp/operators/smtp.py b/providers/smtp/src/airflow/providers/smtp/operators/smtp.py index 9621def333f38..a0cbb4ec282dc 100644 --- a/providers/smtp/src/airflow/providers/smtp/operators/smtp.py +++ b/providers/smtp/src/airflow/providers/smtp/operators/smtp.py @@ -47,7 +47,19 @@ class EmailOperator(BaseOperator): :param custom_headers: additional headers to add to the MIME message. """ - template_fields: Sequence[str] = ("to", "from_email", "subject", "html_content", "files", "cc", "bcc") + template_fields: Sequence[str] = ( + "to", + "subject", + "html_content", + "from_email", + "files", + "cc", + "bcc", + "mime_subtype", + "mime_charset", + "conn_id", + "custom_headers", + ) template_fields_renderers = {"html_content": "html"} template_ext: Sequence[str] = (".html",) ui_color = "#e6faf9" diff --git a/providers/smtp/tests/unit/smtp/operators/test_smtp.py b/providers/smtp/tests/unit/smtp/operators/test_smtp.py index 3d662b1d7349c..c361769d03fe7 100644 --- a/providers/smtp/tests/unit/smtp/operators/test_smtp.py +++ b/providers/smtp/tests/unit/smtp/operators/test_smtp.py @@ -79,5 +79,17 @@ def test_loading_sender_email_from_connection(self, mock_smtplib, mock_hook_conn def test_assert_templated_fields(self): """Test expected templated fields.""" operator = EmailOperator(task_id="test_assert_templated_fields", **self.default_op_kwargs) - template_fields = ("to", "from_email", "subject", "html_content", "files", "cc", "bcc") + template_fields = ( + "to", + "subject", + "html_content", + "from_email", + "files", + "cc", + "bcc", + "mime_subtype", + "mime_charset", + "conn_id", + "custom_headers", + ) assert operator.template_fields == template_fields