Skip to main content

SendGrid email

Integrates with SendGrid to simplify sending emails

Secret Manager setup:

Secret Name: sendgrid

Secret Value:

SENDGRID_API_KEY

Usage

Below is an example of how we send invite emails.

The return object needs to be compliant with SendGrid V3 request body

const extensionBody: SendgridEmailBody = async ({ row, db, change, ref }) => {
return {
// send from field
from: "Rowy<welcome@rowy.app>",
personalizations: [
{
// recipient
to: [{ email: row.email }],
// template parameters
dynamic_template_data: {
inviterName: row.inviter.displayName,
inviteLink: `https://${row.projectId}.rowy.app/signup?email=${row.email}`,
projectId: row.projectId,
},
},
],
// sendgrid template ID
template_id: "d-72072f3se34841e67daa0484fbb377d5",
// helper info to categorise sendgrid emails
categories: ["invites"],
};
};