airflow.providers.microsoft.azure.notifications.msgraph¶
Attributes¶
Classes¶
Send an email from an Office 365 mailbox through the Microsoft Graph |
Module Contents¶
- class airflow.providers.microsoft.azure.notifications.msgraph.MSGraphNotifier(to, subject, html_content, from_email=None, files=None, cc=None, bcc=None, custom_headers=None, conn_id=MSGraphMailHook.default_conn_name, save_to_sent_items=True, **kwargs)[source]¶
Bases:
airflow.providers.common.compat.notifier.BaseNotifierSend an email from an Office 365 mailbox through the Microsoft Graph
sendMailendpoint.EmptyOperator( task_id="task", on_failure_callback=MSGraphNotifier( from_email="airflow@example.com", to="team@example.com", subject="Task {{ ti.task_id }} failed", html_content="Dag {{ ti.dag_id }} failed on {{ ds }}", ), )
- Parameters:
to (str | collections.abc.Iterable[str]) – Recipient email address or list of addresses.
subject (str) – Email subject.
html_content (str) – Email body in HTML format.
from_email (str | None) – The mailbox the message is sent from. Falls back to the
[email] from_emailconfiguration option.files (list[str] | None) – List of file paths to attach to the email.
cc (str | collections.abc.Iterable[str] | None) – Carbon copy recipient email address or list of addresses.
bcc (str | collections.abc.Iterable[str] | None) – Blind carbon copy recipient email address or list of addresses.
custom_headers (dict[str, Any] | None) – Custom internet message headers, whose names have to start with “x-“.
conn_id (str) – The Microsoft Graph API connection id.
save_to_sent_items (bool) – Whether the message is saved in the mailbox’s Sent Items folder.
- template_fields = ('from_email', 'to', 'subject', 'html_content', 'files', 'cc', 'bcc', 'custom_headers')[source]¶
- property hook: airflow.providers.microsoft.azure.hooks.msgraph.MSGraphMailHook[source]¶
Microsoft Graph mail hook.