Email messages

Render an email message as HTML

Changed on

Render the HTML of an email message the way its preview email is rendered. Nothing is sent. The accepted variable fields are the same as for previews - campaigns accept contactProperties, workflows accept contactProperties and eventProperties, and transactional emails accept dataVariables. A variable without a value uses its fallback, or shows a missing-value marker as in a preview email. Supplying a field the parent cannot reference is rejected with 400.

post/v1/email-messages/{emailMessageId}/render

Request

  • Base URL
    https://app.loops.so/api
  • Auth
    HTTP bearer

Request body

contactPropertiesobject

Contact property values to render. Accepted for campaign and workflow emails.

eventPropertiesobject

Event property values to render. Accepted for workflow emails only.

dataVariablesobject

Transactional data variables to render. Accepted for transactional emails only.

Example request

{
  "contactProperties": {
    "firstName": "Alex"
  },
  "eventProperties": {
    "planName": "Pro"
  },
  "dataVariables": {
    "loginUrl": "https://app.company.com/login"
  }
}

Response

Rendered email message.

htmlstring required

The rendered HTML. For emails made in the editor, it includes the rendered subject in <title> and the rendered preview text.

Example response

{
  "html": "<!doctype html><html>...</html>"
}

Changes