SendGrid
SendGrid is one of the messaging providers an organization can send publications through, beside Braze. The difference is who holds the recipients. Braze holds them and fans out; with SendGrid, EdgeKit reads the list, splits the variants, signs every link and sends in chunks itself. SendGrid sends email only.
What you set up in SendGrid
Section titled “What you set up in SendGrid”The API key
Section titled “The API key”One restricted key, saved in Delivery › Configuration › ESP, with these scopes: mail.send, mail.batch.create,
user.scheduled_sends.create, asm.groups.read, asm.groups.suppressions.create,
asm.groups.suppressions.delete, asm.suppressions.global.delete, and the read scopes whitelabel.read,
sender_verification_eligible, user.webhooks.event.settings.read, api_keys.read. Saving the key checks it with
SendGrid: one SendGrid answers 401 to is not saved. Any other answer, 403 or no answer included, saves the key
and replaces what was there, with a warning; a missing scope is named. A key missing one also fails the
publication’s Vendor setup check with the scopes named. Scopes can be edited after the key is created.
Transactional mail, such as sign-in links, uses a second key with mail.send only, set under
Transactional email. A spam report on a newsletter suppresses
that address across the whole account, sign-in links included. Put transactional mail on a SendGrid subuser to keep
them apart.
The region
Section titled “The region”On Delivery › Configuration › ESP, SendGrid region says whether your account lives in the United States or the European Union. Every send, every subscription mirror and every setup check uses that region’s API. It applies to the whole organization, not one site, and takes effect on the next call.
Domain authentication
Section titled “Domain authentication”Every from-address a publication uses must be on a domain you authenticated in SendGrid, or be a verified single sender. Saving a from-address on neither is refused: SendGrid would refuse mail from that address.
The Event Webhook
Section titled “The Event Webhook”One signed Event Webhook posting to https://<tenant host>/v1/webhooks/sendgrid/events, with at least
Unsubscribe, Group Unsubscribe and Spam Report ticked. Turn Signature Verification on, save, and
paste the Verification Key SendGrid then shows into Delivery › Configuration › ESP. An
unsubscribe or a spam report made in SendGrid then reaches EdgeKit, so the next sync does not put the person back.
Other events are counted and dropped. The publication’s Vendor setup check warns while no enabled, signed webhook
sending those three events points at your tenant.
Newsletter lists on SendGrid
Section titled “Newsletter lists on SendGrid”A list on SendGrid names one unsubscribe group in your account. The list form lists the account’s groups; pick one. One group backs one list, and an account holds at most 200 groups.
EdgeKit mirrors each person’s standing into the group: unsubscribed adds them to the group’s suppressions, subscribed removes them, and a re-subscribe after an unsubscribe made in SendGrid also lifts the global suppression. Before every add EdgeKit checks the group still exists, because SendGrid would otherwise suppress the address globally. A list whose group was deleted stops syncing, with the group named on each row.
An erased user is mirrored nowhere: their address is gone, and EdgeKit never mails an erased person again.
Publications on SendGrid
Section titled “Publications on SendGrid”- Channel: an email channel through SendGrid, under Messaging › Configuration › Channels. It has no setting of its own. SendGrid has no push; a publication may still send push through Braze.
- Sender: on the publication’s settings, From and an optional Reply-to. There is no campaign.
- Delivery segments: a bucket range from
0to9999, under Messaging › Configuration › Segments. Every person sits in one bucket, fixed for good and the same in every publication, so0-4999and5000-9999are a 50/50 test, and0-999beside1000-9999a 10% sample. Together a publication’s active variants’ ranges must cover0-9999, each bucket once, so nobody on the list is left out. You pick every variant’s range on the publication’s ESP Configuration tab and save them at once; the save, an edition’s Checks and the deploy each refuse an overlap or an uncovered bucket by name. A variant has no message variation id. - Experiments: an edition’s experiment arms work as on Braze. EdgeKit renders the edition once per combination of arms and sends each person the chunk for theirs, with that combination’s subject and preheader; SendGrid’s statistics carry a category per experiment and arm. At most eight combinations per variant. Exposures are logged once the send can no longer be cancelled, for the people inside the variants’ ranges only.
- Ad slots: work as on Braze, with
{email_md5},{email_sha256}and{email}filled for each recipient. - Not on SendGrid: a personalised feed, a Braze tag such as
${braze_id}in an ad slot’s URL, and a link template with Braze tags. The deploy names each.
How a SendGrid send goes out
Section titled “How a SendGrid send goes out”At the send time the edition is rendered once per variant, as always, with a placeholder where each recipient’s value goes. EdgeKit then opens one batch in SendGrid and schedules every chunk for fifteen minutes later, reads the list in pages, keeps each variant’s range and sends chunks of up to 1,000 recipients, each with their first name, their own signed unsubscribe link and their one-click unsubscribe headers.
Until ten minutes before that time the batch can still be cancelled, and that is what happens on any failure: a chunk SendGrid refuses, EdgeKit stopping mid-way, or a retry finding a page already started. Nothing reaches an inbox, the sends are marked failed with the reason, and the edition can be resent. Past that moment a failure is marked unknown, since some chunks may have gone out, and is never retried on its own. An instant send therefore lands about fifteen minutes after you send it.
Every request carries a category per publication, per edition and per variant, so SendGrid’s own statistics answer how an edition did, and custom arguments naming the edition, variant, list and site, which come back on every webhook event. Subscription tracking is off per message, so SendGrid adds no global unsubscribe link and no header of its own. An edition goes out under its list’s unsubscribe group, though, and SendGrid appends its group unsubscribe line to such a message. EdgeKit keeps that line out of the HTML part, which carries EdgeKit’s link only. The plain-text part still gets SendGrid’s line; an unsubscribe made through it reaches EdgeKit through the Event Webhook.
The unsubscribe link is EdgeKit’s, as on Braze. On SendGrid it names the recipient’s EdgeKit user id, and EdgeKit signs it at the send; clicking it works as described in How an edition is sent.
A test send goes to the test group now, under no batch, with the subject prefixed [TEST · <variant>].