Email

Create an email template

A template has a name, a subject and html or text with variables: {{name}}, or {{name|there}} with a fallback when the value is missing. Values in html are escaped. style site (default) puts the email in the style of the project's site: its name, logo and colors. Send it with POST /emails and template_id plus data, use it in an automation or a sequence, or preview it first. At most 200 templates per project.

post/email-templates

Request

  • Base URL: https://api.hypamoon.com/api/v1
  • URL: https://api.hypamoon.com/api/v1/email-templates
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://app.hypamoon.com/oauth/authorize, token URL https://api.hypamoon.com/oauth/token, scopes: messages:write)

Request body

namestring required

A name for the template, unique in the project, like "Welcome" or "Order shipped".

subjectstring required

The subject, with variables like {{name}}.

htmlstring

The HTML body with variables, like <p>Hi {{name|there}},</p>. Values are escaped. No scripts or forms.

textstring

The plain text body with variables. Without it, the text comes from the html.

style'site' | 'none'

site (default): the email gets the name, logo and colors of the project's site around it. none: the html is sent as it is.

site_idstring uuid

Optional. The site whose style to use; without it the project's first site.

Response

The template.

idstring uuid required
namestring required
subjectstring required
htmlstring nullable required
textstring nullable required
style'site' | 'none' required

site: the name, logo and colors of the project's site around the email. none: sent as it is.

site_idstring uuid nullable required
variablesstring[] required

The variables in the subject and content, like name or order_number.

created_atstring date-time required
updated_atstring date-time required

Changes

No recorded changes to this operation across all 1 revision of this API.