Skip to main content
POST
/
email_templates
/
{id}
/
send
Send an email based off an email template
curl --request POST \
  --url https://api.pocketflows.com/email_templates/{id}/send \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '{
  "from": "<string>",
  "attachments": [
    {
      "content": "<string>",
      "name": "<string>"
    }
  ],
  "to": "<string>",
  "variables": {}
}'
{
  "id": "<string>",
  "created_at": "<string>",
  "customer": "<string>",
  "subject": "<string>",
  "sent_at": "<string>",
  "failed_at": "<string>",
  "failed_reason": "<string>",
  "to_email_address": "<string>",
  "sendgrid_message_id": "<string>",
  "paubox_message_id": "<string>",
  "postmark_message_id": "<string>",
  "ok": true
}

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
  • Option 1
  • Option 2
from
string
required

The ID of the email address from which to send the email

to
string
required

The email address to send the email to

attachments
object[]

An array of attachments to include with the email

variables
object

The variables to be injected into the email template

Response

200 - application/json

The sent SentEmail object

id
string
required

The ID of the campaign

created_at
string
required

The time when the campaign was created in ISO 8601 format

customer
string | null
required

The ID of the customer that was sent the email

subject
string
required

The subject of the email

sent_at
string | null
required

The time when the email was sent in ISO 8601 format

failed_at
string | null
required

The time when the email failed to send in ISO 8601 format

failed_reason
string | null
required

The reason the email failed to send

to_email_address
string | null
required

The email address the email was sent to

ok
boolean
required

Whether the email was sent successfully

sendgrid_message_id
string | null

Sendgrid's returned message ID

paubox_message_id
string | null

Paubox's returned message ID

postmark_message_id
string | null

Postmark's returned message ID