Send email notifications.
Attributes
| Attribute | Type | Description |
|---|---|---|
| recipients | Tuple[str, ...] | Email addresses for the "to" field. |
| cc | Tuple[str, ...] = () | Optional email addresses for the "cc" field. |
| bcc | Tuple[str, ...] = () | Optional email addresses for the "bcc" field. |
| subject | str = "Task {task.name} {run.phase}" | Email subject template (supports template variables). |
| body | str = "Task: {task.name}\nRun: {run.name}\nProject/Domain: {project}/{domain}\nPhase: {run.phase}\nDuration: {run.duration}\nDetails: {run.url}\n" | Plain text body template (supports template variables). |
| html_body | Optional[str] = None | Optional HTML body template (supports template variables). When provided, the email is sent as multipart with both plain text and HTML. |
Constructor
Signature
def Email(
on_phase: [ActionPhase](../../models/actionphase.md?sid=flyte_models_actionphase) = null,
recipients: Tuple[str, ...] = null,
cc: Tuple[str, ...] = (),
bcc: Tuple[str, ...] = (),
subject: str = "Task {task.name} {run.phase}",
body: str = "Task: {task.name}\nRun: {run.name}\nProject/Domain: {project}/{domain}\nPhase: {run.phase}\nDuration: {run.duration}\nDetails: {run.url}\n",
html_body: Optional[str] = null
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| on_phase | [ActionPhase](../../models/actionphase.md?sid=flyte_models_actionphase) = null | ActionPhase(s) to trigger notification (e.g., ActionPhase.FAILED or (ActionPhase.FAILED, ActionPhase.TIMED_OUT)) |
| recipients | Tuple[str, ...] = null | Email addresses for the "to" field. |
| cc | Tuple[str, ...] = () | Optional email addresses for the "cc" field. |
| bcc | Tuple[str, ...] = () | Optional email addresses for the "bcc" field. |
| subject | str = "Task {task.name} {run.phase}" | Email subject template (supports template variables). |
| body | str = "Task: {task.name}\nRun: {run.name}\nProject/Domain: {project}/{domain}\nPhase: {run.phase}\nDuration: {run.duration}\nDetails: {run.url}\n" | Plain text body template (supports template variables). |
| html_body | Optional[str] = null | Optional HTML body template (supports template variables). When provided, the email is sent as multipart with both plain text and HTML. |