Appearance
Function: draftEmail()
ts
function draftEmail(ctx: Context, email: Email): Promise<void>;Defined in: src/email/index.ts:73
Open the default email client with a prefilled recipient, subject, and body.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | Context | The context for automation. |
email | Email | The email to draft. |
Returns
Promise<void>
Throws
Will throw an error if the URL-encoded mailto link exceeds 2000 characters.
Example
ts
await draftEmail(ctx, {
to: ['bookclub@example.com'],
subject: 'Next Read: Dune',
text: 'Hi everyone,\n\nOur next book is Dune by Frank Herbert. Grab a copy before next Thursday.\n\nHappy reading!',
});