Skip to content
You're viewing documentation for v0.6.4. It may be out of date.Go to latest
Email SDK
Esc
↑↓navigate↵open⌘Jpreview
On this page

SendGrid

Send through the Twilio SendGrid Mail Send API with the fullest field support of any adapter.

The SendGrid adapter calls the Twilio SendGrid Mail Send API over fetch — no extra dependency. It supports every EmailMessage field: recipients land in a personalizations entry, metadata becomes custom_args, and tags become categories.

SendGrid logo
SendGrid@opencoredev/email-sdk/sendgrid
Provider docs

Configure

Create an API key with Mail Send permission in the SendGrid dashboard and verify the sender identity or domain you use in from.

PropType
apiKeystring

SendGrid API key with Mail Send permission.

Typestring
baseUrl?string

Override the API origin, e.g. for a proxy.

Typestring
Default"https://api.sendgrid.com"
fetch?typeof fetch

Custom fetch implementation for tests or special runtimes.

Typetypeof fetch

Send

Everything maps: cc, bcc, headers, attachments, tags, metadata, and even multiple replyTo addresses (sent as reply_to_list).

SendGrid’s send endpoint returns 202 Accepted with an empty body, so the adapter reads result.id from the x-message-id response header. metadata values arrive in SendGrid event webhooks as custom_args; tag values arrive as categories.

Verify from the CLI

Drop --dry-run for one real send — account review and sender verification can block delivery even when the payload validates, and only a live send proves they are done.

Last updated on