Email

Send email messages with the email built-in.

Message

Send an email via a SMTP server.
FieldTypeDefaultDescription
sender{email: string, name: string}RequiredThe email sender.
recipients[]string
- or -
[]{email: string, name: string}
RequiredList of addresses to email. A name can optionally be provided for each recipient.
subjectstring""The subject of the email.
messagestring""The content of the email.

Usage

javascript
Copied
1
import airplane from "airplane";
2
3
export default airplane.task(
4
{
5
slug: "send_email",
6
resources: ["my_email"],
7
},
8
async (params) => {
9
await airplane.email.message(
10
"my_email", // The slug of the Email resource.
11
{ email: "hello@airplane.dev", name: "Airplane" }, // The sender.
12
[{ email: params.email, name: params.name }], // The list of recipients.
13
{
14
subject: "Welcome to Airplane!",
15
message: `Hello, ${params.name}! To get started with Airplane, visit the docs: https://docs.airplane.dev`,
16
}
17
);
18
}
19
);