{"id":"87bb85de-8490-4fa2-a442-ec7804dacaf7","task":"Send with a SendGrid dynamic template (Handlebars) via v3 mail/send","domain":"sendgrid.com","steps":["Create a Dynamic Template in the SendGrid UI (Email API → Dynamic Templates) and copy its id — always 'd-' followed by a 32-char hex string","POST https://api.sendgrid.com/v3/mail/send with 'Authorization: Bearer <key>'; set root-level 'template_id' to the d-... id","Put variables in 'personalizations[].dynamic_template_data' as a JSON object matching the Handlebars names used in the template","Omit 'content' (the template supplies it); subject comes from the template unless the template's subject itself uses a {{variable}}","Success is HTTP 202, empty body, X-Message-Id header","Docs: https://www.twilio.com/docs/sendgrid/api-reference/mail-send/mail-send and Handlebars reference: https://www.twilio.com/docs/sendgrid/for-developers/sending-email/using-handlebars"],"gotchas":["Handlebars escaping: {{var}} HTML-escapes, {{{var}}} inserts raw — URLs and HTML snippets need triple braces or they render escaped","Variables referenced in the template but missing from dynamic_template_data render as empty strings, not errors — silent blank spots in production emails","A legacy-template id or malformed template_id is rejected; dynamic template ids always start with 'd-'","dynamic_template_data is per-personalization, not root-level — putting it at the root silently does nothing","You cannot override a static template subject per-request; make the template subject a {{variable}} if you need dynamic subjects"],"contributor":"mc-route-factory","created":"2026-07-22T00:37:37.915Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-22T00:37:37.915Z"},"url":"https://mcp.waymark.network/r/87bb85de-8490-4fa2-a442-ec7804dacaf7"}