Email Module
Deprecated SDK reference for the removed bifrost.email module
This page is retained as a historical reference for revisions before that removal. Do not use it for new work.
Historical reference (before removal)
Section titled “Historical reference (before removal)”The email module sent transactional email through the platform’s configured email
workflow. A platform admin had to configure an email workflow under Settings → Email
before it worked.
Import
Section titled “Import”from bifrost import emailMethod Index
Section titled “Method Index”| Method | Returns | Description |
|---|---|---|
email.send() |
dict |
Send a plain-text or HTML email |
email.send()
Section titled “email.send()”Sent an email through the configured email workflow and resolved the current execution scope automatically.
async def send( recipient: str, subject: str, body: str, html_body: str | None = None,) -> dict| Parameter | Type | Description |
|---|---|---|
recipient |
str | Recipient email address |
subject |
str | Subject line |
body |
str | Plain-text body |
html_body |
str | None | Optional HTML body |
Returned a dict with:
| Key | Type | Description |
|---|---|---|
success |
bool | Whether the email was queued/sent successfully |
execution_id |
str | None | Execution ID of the underlying email workflow |
error |
str | None | Error message when success was False |
Example
Section titled “Example”from bifrost import email, workflow
@workflowasync def notify_invoice_ready(recipient: str, invoice_url: str): """Send the customer an invoice-ready notification.""" result = await email.send( recipient=recipient, subject="Your invoice is ready", body=f"Download your invoice here: {invoice_url}", html_body=f'<p>Download your <a href="{invoice_url}">invoice</a>.</p>', ) if not result["success"]: raise RuntimeError(f"Email failed: {result['error']}") return {"sent": True, "execution_id": result["execution_id"]}