{"_id":"590fc3ec562f90190067aead","version":{"_id":"5588b8a2f6c18d0d005bba06","project":"5588b8a2f6c18d0d005bba03","__v":15,"createdAt":"2015-06-23T01:38:42.696Z","releaseDate":"2015-06-23T01:38:42.696Z","categories":["5588b8a3f6c18d0d005bba07","5588e9689cfea70d00371df3","5588f5921163180d00b64704","561598b121e9110d0078025a","5616f1c9d170d00d00189306","5616f5c3a410c90d00c6121e","561803dcf8c9632100ac7592","563667280441020d0000e9eb","5642570d9417b40d00c0fcd3","57bf5f02efe0050e00d50bd5","57f53fb368a53b2000e03f0f","57f55187440418170086325a","582e3afa72fd270f0006926d","5841faa973967b0f004b4a2b","58db348aa32c8419002433bb"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"parentDoc":null,"project":"5588b8a2f6c18d0d005bba03","user":"5588b847f6c18d0d005bba01","__v":10,"category":{"_id":"57f53fb368a53b2000e03f0f","version":"5588b8a2f6c18d0d005bba06","project":"5588b8a2f6c18d0d005bba03","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-10-05T18:00:19.547Z","from_sync":false,"order":0,"slug":"api","title":"REST API"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-05-08T01:03:40.208Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"post","results":{"codes":[{"status":200,"language":"json","code":"curl -XPOST -v \\\n    --header 'Content-Type: application/json' \\\n    --header \"X-API-Token: <api token>\" \\\n    \"https://api.mixmax.com/v1/snippets/590e9957d5ed831137abe926/send\" \\\n    -d '{\"to\":[{\"email\":\"hello:::at:::mixmax.com\",\"name\":\"Mixmax Hello\"}],\"variables\":{\"myvar\":\"true\"}}'","name":""}]},"settings":"","auth":"required","params":[{"_id":"590fc5beadf5bd0f00a1d76d","ref":"","in":"body","required":true,"desc":"Who to send the template to. Array of objects with keys 'email' and 'name' (optional).","default":"","type":"array_object","name":"to"},{"_id":"590fc5beadf5bd0f00a1d76c","ref":"","in":"body","required":false,"desc":"Who to send the template to. Array of objects with keys 'email' and 'name' (optional).","default":"","type":"array_object","name":"cc"},{"_id":"590fc5beadf5bd0f00a1d76b","ref":"","in":"body","required":false,"desc":"Who to send the template to. Array of objects with keys 'email' and 'name' (optional).","default":"","type":"array_object","name":"bcc"},{"_id":"590fc5beadf5bd0f00a1d76a","ref":"","in":"body","required":false,"desc":"Subject to use for the message. If omitted, defaults to the template's `title`.","default":"","type":"string","name":"subject"},{"_id":"590fdc2956b228250001dc58","ref":"","in":"body","required":false,"desc":"True to turn tracking on for this message","default":"true","type":"boolean","name":"trackingEnabled"},{"_id":"590fdc2956b228250001dc57","ref":"","in":"body","required":false,"desc":"If the template has variables, this object will provide values to substitute the variables.","default":"{}","type":"object","name":"variables"},{"_id":"5972544c1681e5001a2a2173","ref":"","in":"body","required":false,"desc":"Optional to send the message later. Message will be placed in your Mixmax Outbox.","default":"send immediately","type":"timestamp","name":"scheduledAt"}],"url":"/v1/snippets/:id:/send"},"isReference":true,"order":117,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Have you seen Incoming Webhooks?\",\n  \"body\": \"See [Incoming Webhooks](http://success.mixmax.com/article/205-incoming-webhooks) that allow you to easily send an email without writing code\"\n}\n[/block]\nIf the template subject or body has special variables `{{first name}}`, `{{last name}}`,  `{{email}}`, or `{{name}}`, these will be replaced automatically with the details of the first recipient. Additionally,  `{{sender name}}` and `{{sender first name}}` are supported.\n\nThis API will NOT send an email if the template has variables in it (eg `{{my variable}}`) that are unresolved at the time of sending. It will return an HTTP `400`.","excerpt":"Emails a template, optionally substituting variables","slug":"snippetsidsend","type":"endpoint","title":"/snippets/:id/send"}

post/snippets/:id/send

Emails a template, optionally substituting variables

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

to:
required
array of objects
Who to send the template to. Array of objects with keys 'email' and 'name' (optional).
cc:
array of objects
Who to send the template to. Array of objects with keys 'email' and 'name' (optional).
bcc:
array of objects
Who to send the template to. Array of objects with keys 'email' and 'name' (optional).
subject:
string
Subject to use for the message. If omitted, defaults to the template's `title`.
trackingEnabled:
booleantrue
True to turn tracking on for this message
variables:
object{}
If the template has variables, this object will provide values to substitute the variables.
scheduledAt:
timestampsend immediately
Optional to send the message later. Message will be placed in your Mixmax Outbox.

Result Format


Documentation

[block:callout] { "type": "info", "title": "Have you seen Incoming Webhooks?", "body": "See [Incoming Webhooks](http://success.mixmax.com/article/205-incoming-webhooks) that allow you to easily send an email without writing code" } [/block] If the template subject or body has special variables `{{first name}}`, `{{last name}}`, `{{email}}`, or `{{name}}`, these will be replaced automatically with the details of the first recipient. Additionally, `{{sender name}}` and `{{sender first name}}` are supported. This API will NOT send an email if the template has variables in it (eg `{{my variable}}`) that are unresolved at the time of sending. It will return an HTTP `400`.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}