Send Email
Resend.com is currently in private beta but you can request early access here.
If you’d like to render emails using React, please see the React.email docs
Params
A unique string. Please see the Keys and Resumability doc for more info.
The text of the email. If html
is provided, this will be used as the
plain text version of the email.
The HTML of the email. If text
is provided, this will be used as the
HTML version of the email.
A React component that will be rendered to HTML and used as the email content. Please see the React.email docs for more info
The subject of the email.
The email address of the sender.
One or more email addresses of the recipients.
One or more email addresses of the CC recipients.
One or more email addresses of the BCC recipients.
An optional email address to use as the reply-to address.
Response
The ID of the email.
The email address of the sender.
The email address of the recipient.
The date and time the email was created.
Example Workflows
import * as github from "@trigger.dev/github";
import * as resend from "@trigger.dev/resend";
import { CriticalIssueEmail } from "./emails";
new Trigger({
id: "email-ops",
name: "On Critical Issue",
on: github.events.issueEvent({
repo: "triggerdotdev/trigger.dev",
}),
run: async (event, ctx) => {
if (event.action === "labeled" && event.label.name === "critical") {
await resend.sendEmail("🚨 Alert Ops", {
to: "ops@trigger.dev",
from: "internal@trigger.dev",
subject: `Critical issue: ${event.issue.title}`,
react: (
<CriticalIssueEmail
issue={event.issue}
sender={event.sender}
repo={event.repository}
/>
),
});
}
},
}).listen();
Example Response
{
"id": "1673618429",
"from": "internal@trigger.dev",
"to": "ops@trigger.dev",
"created_at": "2023-01-24T14:38:26Z"
}