Save an email template
POST/v1/templates
A subject and an HTML and/or text body with {{placeholders}}. Send it with template_id and variables on POST /v1/emails. Names are one per account.
Body
| Field | Type | Description |
|---|---|---|
| name | string | |
| subject | string | |
| html | string | |
| text | string |
Example
curl -X POST https://api.woyra.io/v1/templates \
-H "Authorization: Bearer $WOYRA_KEY" \
-H 'Content-Type: application/json' \
-d '{
"name": "Receipt",
"subject": "Your receipt, {{name}}",
"html": "<p>Hi {{name}}, you paid {{amount}}.</p>"
}'Response
201 The saved template.
| Field | Type | Description |
|---|---|---|
| object | "template" | |
| id | string | |
| name | string | |
| subject | string | |
| html | string | |
| text | string | |
| variables | array of string | The placeholders the template uses. |
| created_at | timestamp | |
| updated_at | timestamp |
Errors
| Status | Codes |
|---|---|
| 400 | invalid_request, unsupported_version |
| 401 | authentication_required, invalid_api_key |
Also in Emails
- GET /v1/emails — List emails
- POST /v1/emails — Send an email
- GET /v1/emails/{id} — Retrieve an email
- POST /v1/emails/{id}/cancel — Cancel a scheduled email
- POST /v1/emails/batch — Send a batch of emails
- GET /v1/templates — List templates
- GET /v1/templates/{id} — Retrieve a template
- PATCH /v1/templates/{id} — Change a template
- DELETE /v1/templates/{id} — Delete a template
- GET /t/o/{token} — Open tracking image
- GET /t/c/{token} — Click tracking redirect
- GET /v1/emails/inbound — Mail received on your domains
- GET /v1/emails/inbound/{id} — Retrieve a received email
- GET /v1/emails/inbound/{id}/attachments/{attachment_id} — Download an attachment
- GET /v1/emails/threads/{id} — A conversation