How-toFor engineers

Send an email with Mailchimp or Mandrill

Send a transactional email from a care flow through Mailchimp's Mandrill API, using a REST API call action.

Mailchimp sends transactional email through Mandrill. Where an organization already uses Mailchimp, a care flow can send through that API rather than through Awell's built-in email action.

For plain templated email without a third-party account, use Send email notifications instead. Take this route only when Mailchimp's templates or deliverability are the reason.

Set up Mailchimp first

Follow Mailchimp's own Transactional API quick start to get:

  • an API key for the Transactional API
  • a verified domain to send from

Send a test email from Mailchimp before wiring anything into a care flow. If it doesn't work there, it won't work from Awell either, and it's harder to debug from inside a care flow.

Configure the API call action

Use a REST API call action.

Endpoint, one of:

POST https://mandrillapp.com/api/1.0/messages/send
POST https://mandrillapp.com/api/1.0/messages/send-template

Use send-template when the content lives in a Mailchimp template, and send when the care flow supplies the body.

Headers:

Content-Type: application/json

Body. Mandrill expects the API key inside the JSON body rather than in a header:

{
  "key": "",
  "message": {
    "from_email": "",
    "to": [{ "email": "" }],
    "subject": "",
    "html": ""
  }
}

Fill the values with variables so each email goes to the right patient, and keep the API key in a constant.

Next steps

Storing the response in a data point lets the care flow react to a send failure rather than assuming it worked. See The API call action.

On this page