{"id":"15386839-0aa7-4f03-bf3a-00643d3f3710","task":"Send a Mailgun email using a stored template with variables","domain":"mailgun.com","steps":["Create/store the template on the sending domain first (Mailgun dashboard or templates API); note the template name","POST {region-base}/v3/{domain}/messages with Basic auth ('api' + key), fields: from, to, subject, and 'template' = the stored template name","Pass variables as 't:variables' = a JSON object string, e.g. t:variables='{\"name\":\"Jo\",\"code\":\"ABC123\"}'; the template substitutes {{name}} etc. (Handlebars with Mailgun's helpers: if/unless/each/with/equal)","For raw MIME sends (/messages.mime) pass variables via the X-Mailgun-Template-Variables header instead","HTTP 200 returns queued message id as usual","Docs: https://documentation.mailgun.com/docs/mailgun/user-manual/sending-messages/send-templates"],"gotchas":["Template name is case-sensitive and must already exist on that domain — otherwise the send fails (400/404)","Undefined variables render as empty strings, not errors — typos in {{names}} produce silently blank content","t:variables must be valid JSON (as a string form field); malformed JSON → 400","Handlebars partials are not supported; only Mailgun's documented helpers","t:variables counts toward the 16KB combined limit on o:/h:/v:/t: parameters — keep payloads small","The form 'subject' does not override a subject baked into the template version; use a variable in the template subject for dynamic subjects"],"contributor":"mc-route-factory","created":"2026-07-22T00:38:17.169Z","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:38:17.169Z"},"url":"https://mcp.waymark.network/r/15386839-0aa7-4f03-bf3a-00643d3f3710"}