How to use Draftship with SendGrid
Save a Draftship export as a SendGrid Dynamic Template, parameterize it with Handlebars, and trigger sends via the v3 mail send API. Here's the path that bypasses Legacy Templates and respects Outlook fidelity.
SendGrid is the default for engineering teams sending transactional email through an API. The product has two template systems: Legacy Templates (deprecated, simple substitution) and Dynamic Templates (Handlebars-powered, conditionals, loops). Use Dynamic for everything new. Legacy still exists for backward compatibility but doesn't support modern features.
Where SendGrid accepts pasted HTML
In the SendGrid dashboard, navigate to Email API → Dynamic Templates. Click Create a Dynamic Template. After naming it, click Add Version → Code Editor. Paste your full Draftship export.
The version system matters: each Dynamic Template has multiple versions, only one is "active". Iterate by creating new versions, not editing the active one. The version system is your rollback plan.
Handlebars personalization
SendGrid uses Handlebars, which is similar to Liquid but with slightly different syntax for conditionals.
| Draftship | SendGrid |
|---|---|
{{ first_name }} | {{first_name}} |
{{ last_name }} | {{last_name}} |
{{ email }} | {{email}} |
{{ company }} | {{company}} |
| Default fallback | {{#if first_name}}{{first_name}}{{else}}there{{/if}} |
| Loops | {{#each items}}<p>{{this.name}}</p>{{/each}} |
| Negation | {{#unless condition}}...{{/unless}} |
Handlebars doesn't have inline default filters like Liquid. The conditional pattern is verbose; consider preprocessing on your side and passing already-defaulted values in the API payload.
Sending via the v3 API
The transactional path uses POST /v3/mail/send with a payload like:
json{ "personalizations": [{ "to": [{ "email": "user@example.com" }], "dynamic_template_data": { "first_name": "Alex", "company": "Acme" } }], "from": { "email": "noreply@yourdomain.com" }, "template_id": "d-a1b2c3..." }
The d- prefix on template_id distinguishes Dynamic from Legacy. The dynamic_template_data object holds the merge values that resolve Handlebars at send.
Image hosting
SendGrid has no built-in CDN. Use your own CDN (Cloudflare, S3+CloudFront, Bunny). Hardcode absolute URLs in Draftship Image blocks before exporting. SendGrid doesn't auto-host pasted external images.
Marketing Campaigns vs the v3 API
SendGrid splits marketing email into a separate product called Marketing Campaigns. Dynamic Templates work in both, but Marketing Campaigns adds a list-and-segment layer for one-to-many sends. The transactional API is one-to-one only.
If you build the email once in Draftship, you can reuse the template across Marketing Campaigns and the transactional API by referencing the same template_id.
Test send checklist
- Use Test Data in the template editor with a realistic JSON payload.
- Trigger a real API send to your own inbox before going live with production traffic.
- Run the rendered email through the size checker.
- Verify Sender Authentication (SPF, DKIM, DMARC) is configured for the from-domain.
When to use Marketing Campaigns vs Dynamic Templates directly
Use Marketing Campaigns when you need list management, segmentation, and a UI for non-technical operators. Use Dynamic Templates plus the API when your code drives the send and you only need template rendering. Both reference the same Draftship-built artifact.
For DMARC and authentication setup, see SPF, DKIM, and DMARC explained.