What the API and SendGrid serve
Maiilo has two ways to deliver a template: your application fetches it through the API, or Maiilo pushes it to SendGrid. Both use the same thing: the template’s published version.
The API
Section titled “The API”GET /api/v1/templates/:id returns the published version’s stored HTML, subject and
variables. The API does not render the template when you call it, so:
- Editing the draft does not change the response.
- Editing a shared block does not change the response.
- Every request for the same version returns the same bytes.
- Only publishing changes the response.
A template that has never been published returns 404 with
{"error":"template_not_published"}. See Get template by ID.
SendGrid
Section titled “SendGrid”Push to SendGrid sends the published version’s HTML and subject into a SendGrid dynamic template, without rewriting your HTML.
Publishing a new version does not push it automatically. SendGrid keeps the version you last pushed, and Maiilo shows that it has fallen behind until you push again. See Keep SendGrid in sync.
Summary
Section titled “Summary”| Action | Changes the API response? | Changes SendGrid? |
|---|---|---|
| Edit the draft (autosave) | No | No |
| Edit a shared block | No | No |
| Restore an old version | No (it only changes the draft) | No |
| Publish | Yes, immediately | No, until you push |
| Push to SendGrid | No | Yes |
Why it works this way
Section titled “Why it works this way”If the API rendered the draft on every request, a typo saved mid-edit or a change to a shared footer could reach customers without anyone deciding to ship it. Serving a frozen version means every change your customers see went through a deliberate publish, and the version history records it.