Skip to main content

SendGrid email

Integrates with SendGrid to simplify sending emails.

Sendgrid Email Extension Tutorial! 💡

We have created an extensive tutorial for you on how to successfully create an Extension that sends emails via Sendgrid. Check out the tutorial here for step-by-step instructions and guidance.

Secret Manager setup:

Navigate to Google Secret Managerand add a new secret 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"],
};
};