Skip to main content
POST
/
email_templates
/
{id}
Update an email template
curl --request POST \
  --url https://api.pocketflows.com/email_templates/{id} \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "subject": "<string>",
  "body": "<string>",
  "template_html": "<string>",
  "template_json": {},
  "new_template_json": {},
  "new_template_html": "<string>",
  "attachments": [
    "<string>"
  ],
  "kind": "unlayer",
  "metadata": {}
}'
{
  "id": "<string>",
  "name": "<string>",
  "subject": "<string>",
  "kind": "plaintext",
  "body": "<string>",
  "template_json": "<any>",
  "template_html": "<string>",
  "attachments": [
    {
      "content": "<string>",
      "name": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

id
string
required

The ID of the email template

Body

application/json
name
string

The name of the email template

subject
string

The subject of the email template. Variables are supported via {{ variableName }}

body
string

The plaintext version of the body of the email template. Variables are supported via {{ variableName }}

template_html
string

The HTML representation of the email template. Mutually exclusive with plain text email templates.

template_json
object

The JSON representation of the email template. This will override the name, subject, and body properties

new_template_json
object

The JSON representing the rich text email template. Mutually exclusive with plain text email templates

new_template_html
string

The HTML representation of the rich text email template. Mutually exclusive with plain text email templates

attachments
array

An array of existing attachment IDs or new attachments that will always be sent with this template

kind
enum<string>

The kind of the email template

Available options:
unlayer,
editor,
old_editor,
html,
plaintext
metadata
object

The metadata for the email template

Response

200 - application/json

The updated EmailTemplate object

id
string
required

The ID of the email template

name
string
required

The name of the email template

subject
string
required

The subject of the email template. Variables are supported via {{ variableName }}

kind
enum<string>
required

The kind of the email template

Available options:
plaintext,
html,
unlayer,
old_editor,
editor
body
string | null
required

The body of the email template. May be null. Variables are supported via {{ variableName }}

template_json
any
required

The JSON representing the rich text email template. May be null

template_html
string | null
required

The HTML representation of the rich text email. May be null

attachments
object[]
required

An array of attachment associted with the email template. Will be sent with every email built from this template

I