airflow.providers.smtp.notifications.smtp¶
Attributes¶
Classes¶
SMTP Notifier. |
Module Contents¶
- class airflow.providers.smtp.notifications.smtp.SmtpNotifier(to, from_email=None, subject=None, html_content=None, files=None, cc=None, bcc=None, mime_subtype='mixed', mime_charset='utf-8', custom_headers=None, smtp_conn_id=SmtpHook.default_conn_name, *, template=None)[source]¶
Bases:
airflow.notifications.basenotifier.BaseNotifier
SMTP Notifier.
Accepts keyword arguments. The only required arguments are from_email and to. Examples:
EmptyOperator(task_id="task", on_failure_callback=SmtpNotifier(from_email=None, to="myemail@myemail.com")) EmptyOperator( task_id="task", on_failure_callback=SmtpNotifier( from_email="myemail@myemail.com", to="myemail@myemail.com", subject="Task {{ ti.task_id }} failed", ), )
You can define a default template for subject and html_content in the SMTP connection configuration.
- Parameters:
smtp_conn_id (str) – The smtp connection id that contains the information used to authenticate the client.
- template_fields = ('from_email', 'to', 'subject', 'html_content', 'files', 'cc', 'bcc', 'mime_subtype',...[source]¶
- property hook: airflow.providers.smtp.hooks.smtp.SmtpHook[source]¶
Smtp Events Hook.