Skip to content

SendGrid

Connect your SendGrid account once, then push the templates you publish in Maiilo straight into it. Maiilo records every push and tells you when SendGrid is running an older version than the one you published.

Pro feature · Setup takes about 3 minutes · You need a SendGrid account

  • A Maiilo Pro plan. Connecting SendGrid and pushing templates are Pro features. A Pro trial counts. On Free, the SendGrid card shows Upgrade to Pro instead of the key field.

    If your plan lapses, templates already in SendGrid are not affected and your stored key stays as it is. You just cannot push new versions until you are back on Pro.

  • A SendGrid account where you can create API keys (an account owner or an admin).

  • At least one published template. Maiilo pushes the version you published, never the draft.

  1. In SendGrid, go to Settings → API Keys and choose Create API Key.
  2. Name it something you will recognise later, such as Maiilo.
  3. Choose Full Access, or choose Restricted Access and give Template Engine read and write access. See the permissions reference.
  4. Copy the key. SendGrid shows it only once. It starts with SG..
  1. Go to Integrations in the Maiilo sidebar (app.maiilo.io/integrations).
  2. Paste the key into the SendGrid card, exactly as SendGrid gave it: no quotes, no Bearer prefix, no spaces at either end.
  3. Press Connect SendGrid.

Maiilo checks the key with SendGrid before storing it: that it is valid and has Template Engine access. If the check fails, nothing is stored and Maiilo tells you why. See Troubleshooting.

The card shows a Connected badge and Connected as followed by your SendGrid account email, so you can check you connected the right account. It also shows when the key was last verified.

If the key cannot read your account email, the card shows your SendGrid username instead, or “your SendGrid account”. That is normal for a restricted key and does not affect pushing. Add user.email.read to the key if you want to see the email.

Each template’s details page has a Destination card. It shows SendGrid, whether SendGrid is in sync, which version SendGrid is running, and the push button.

  1. Publish the template. If it has never been published, the button reads Publish before pushing.
  2. Press Push to SendGrid. Maiilo creates a dynamic template in SendGrid named after your template, with one version named after the Maiilo version number, such as Welcome email (v3).
  3. Check it in SendGrid under Dynamic Templates.

SendGrid requires a subject on every template version, and Maiilo pushes the subject of the published version.

  • No subject yet: the button reads Add a subject, then publish. Add one with Edit details, publish, then push.
  • Subject added after the last publish: the button reads Publish to include your subject. Publish, then push.

In both cases nothing is sent to SendGrid until you publish.

After the first push, the button reads Update in SendGrid. Pushing again replaces the content of the existing SendGrid template version instead of adding a new one, so SendGrid has exactly one template per Maiilo template.

If the SendGrid template was deleted in SendGrid, Maiilo creates a new one on the next push and tells you so.

Your full history of versions stays in Maiilo. See History and rollback.

Publishing a new version does not push it automatically. Nothing leaves Maiilo unless you ask, so SendGrid can fall behind after you publish.

Maiilo shows when that happens:

  • On the template’s Destination card, with a Behind status and a line such as “SendGrid has v2, you publish v3”. The push button is on the same card.
  • In the builder toolbar, where the delivery status shows which version SendGrid has.
  • On Needs Attention, in a group listing every template that is behind in SendGrid. Every row starts ticked, so the button reads Re-push all N. Untick any you want to hold back.
  • In the sidebar count of items that need attention.

Pushing the latest published version clears it. Maiilo compares the version you published with the version you pushed every time a page loads, so the warning disappears as soon as they match. There is nothing to dismiss.

Re-publishing templates after a shared block change creates new versions, so those templates then show as behind in SendGrid until you push them.

The details page lists every push attempt for the template, newest first: which version was sent, when, how long it took, and, if it failed, why. Failed attempts are listed on purpose, so if SendGrid does not have what you expect, you can see whether the push ever succeeded.

A template whose latest push in the last 7 days failed also appears on Needs Attention.

A SendGrid key can send mail as you, so here is exactly how Maiilo handles it.

  • Verified before it is stored. A key that fails the check is never saved.
  • Encrypted. Maiilo stores the key encrypted, with an encryption key held outside the database. A copy of the database alone is not enough to read it.
  • Never shown again. No screen in Maiilo displays a stored key, not even masked.
  • Your account email and username are stored in plain text, for the “Connected as” label.
  • Deleted on disconnect. Disconnecting removes the stored key completely.
  • One SendGrid account per Maiilo account. Connecting again replaces the stored key, so old keys do not pile up.

When SendGrid is connected, the card has no key field. To replace the key:

  1. Create the new key in SendGrid.
  2. In Maiilo, press Disconnect on the SendGrid card and confirm.
  3. Paste the new key and press Connect SendGrid.
  4. Once the card shows Connected again, delete the old key in SendGrid.

If the new key belongs to the same SendGrid account, nothing else changes: your templates stay linked to their SendGrid templates, and your push history and sync status carry over. This is true even if the new key has narrower permissions.

Delete the old key in SendGrid last. If you delete it first, Maiilo is left holding a key that no longer works, and your next push fails.

Press Disconnect on the SendGrid card and confirm. The dialog tells you how many templates are linked. Maiilo deletes its copy of your key immediately.

Templates you already pushed stay in SendGrid, and Maiilo remembers which SendGrid template belongs to each one. Reconnect the same account and everything picks up where it left off.

Connect a different SendGrid account and Maiilo forgets those links, because those templates are in the old account. Your next push creates new templates in the new account; the originals stay in the old one.

Full Access covers everything. For a restricted key, these are the scopes that matter:

ScopeWhat it is for
templates.readRequiredFind your existing templates, so Maiilo updates the right one instead of creating duplicates.
templates.createRequiredCreate a template the first time you push.
templates.updateRequiredUpdate the template when you push again.
user.email.readOptionalShows your account email in the “Connected as” label.
user.username.readOptionalUsed for the label when the email cannot be read.

Maiilo does not ask for, and cannot use, permission to send mail, read contacts, view statistics, or change your account settings.

Maiilo’s {{firstName}} syntax is the same as SendGrid’s, and Maiilo creates dynamic templates, which is what makes SendGrid fill variables in. Your variables work as you wrote them.

SendGrid uses Handlebars, which treats a few brace patterns as instructions where Maiilo shows them as plain text:

You typedMaiilo showsSendGrid does
{{ firstName }} (with spaces)the literal textfills in a variable
{{#if user}}…{{/if}}the literal textruns a conditional
{{{value}}}the literal textinserts unescaped HTML
{{user.name}}the literal textlooks up a nested field
an unclosed {{the literal textrejects the whole template

Maiilo pushes your HTML exactly as published and never rewrites it. If you meant any of these as literal text, they will behave differently in SendGrid. A single stray {{ makes SendGrid reject the push; see When a push fails.