Reference

You can also view the API documentation in Postman.

post
Send Email

https://api.encharge.io/v1/emails/send
Send transactional emails with Encharge.
Request
Response
Request
Query Parameters
token
required
string
Your Encharge API key.
Body Parameters
template
optional
string
The name of the email template to use. Only one of `text`, `html` or `template` may be set.
html
optional
string
The content of your HTML email. Only one of `text`, `html` or `template` may be set.
text
optional
string
The content of your plain-text email. Only one of `text`, `html` or `template` may be set.
to
required
string
Email address of the recipient. If the person has been previously created in Encharge, you can pass an object with `userId` and we'll use the email we have for this user.
from
optional
string
Email address of the sender. If you'd like to set the sender name, pass an object with `email` and `name`. If a template is specified, this will overwrite the sender details in the template.
openTracking
optional
boolean
Open tracking creates an event in Encharge, each time a person opens your email. Enabled by default. Pass `false` to disable.
linkTracking
optional
boolean
Link tracking creates an event in Encharge, each time a person clicks a link in your email. Enabled by default. Pass `false` to disable.
templateProperties
optional
object
Dictionary of properties to be replaced in the email. For example, passing {"loginURL":"https://app.encharge.io/login/3n2l3ad99"} will replace `{{ loginURL }}` in the email body or subject.
unsubscribeCheck
optional
boolean
By default, we will not send to people who have unsubscribed from your emails. Using caution, you can send to unsubscribed people by setting this flag to `false`.
UTMTags
optional
boolean
If you've enabled Automatic UTM tagging in your Encharge account, we will tag all links in your emails. To disable this behavior, set this flag to `false`.
Response
200: OK
400: Bad Request
{
"error": {
"message": "Missing email content. Please pass `template`, `html` or `text`",
"stack": "Error: \n at new APIException (/home/slav/code/monorepo/packages/domain/exceptions/api_exceptions.ts:34:18)\n at new BadRequestException (/home/slav/code/monorepo/packages/domain/lib/exceptions/api_exceptions.js:22:9)\n at Function.getTemplate (/home/slav/code/monorepo/packages/api/src/services/TransactionalEmailService.ts:153:15)",
"markdown": "<p>Missing email content. Please pass <code>template</code>, <code>html</code> or <code>text</code></p>\n",
"traceId": "9751fe70-0957-11eb-a6b8-3baf67de29f8"
}
}