Skip to main content

Email API

These instructions describe how to send emails using InTarget Email API

Updated over 3 months ago

Please get in touch with [email protected] to get an access token

Make sure you comply with our Bounce and Complain Policies when using InTarget API

We could stop sendings in case your bounce rate would be >= 5% or complain rate >= 0.05%

Basic recommendations

  1. Implement a double opt-in strategy. When users sign up to receive an email from you, send them a message with a confirmation link, and do not start sending them an email until they confirm their address by clicking that link. A double opt-in strategy helps reduce the number of hard bounces resulting from typographical errors.

  2. When collecting email addresses with a web-based form, perform minimal validation on those addresses upon submission.

Create an Email Template

POST

https://api.intarget.app/rest/email-template/create?access-token=

Request Body:

{
"title": "Welcome Email",
"content": "Hello {unsubscribeUrl}"
}

  • title — template title — required

  • content — HTML content for your template — required

Each email template must contain {unsubscribeUrl} variable

Response Body:

{"id":977}

Before sending it in a JSON field, you must encode the HTML to ensure it doesn't interfere with the JSON structure. This typically involves converting special characters to their corresponding Unicode escape sequences.

Send an Email

POST

https://api.intarget.app/rest/email-message/send?access-token=

Request Body:

{
"templateId": 977,
"type": 1,
"email": "[email protected]",
"playerId": "2023022617000",
"providerId": 17,
"subject": "Hi, {{name}}",
"externalVariables": {
"name": "John"
}
}
  • templateId — template ID created by API or using InTarget email builder — required

  • type — Email type — optional

    • 1 — promotional (by default)

    • 2 — transactional

  • email — valid Email address — required

  • playerId — player ID — optional

  • providerId — Please get in touch with [email protected] if you want to send from several email addresses or domains — optional

  • subject — Email subject — required

  • externalVariables — add any external variables like {name} to your Email template or subject — optional

Response Body:

{
"data": true
}

Statistics for API sendings

GET

https://api.intarget.app/rest/email-message/statistics?from=2023-11-08%2000:00:00&to=2023-11-09%2000:00:00&templateId=977&access-token=

Response Body:

{
"sent": 10,
"delivered": 9,
"opened": 7,
"clicked": 3,
"bounced": 1,
"complaint": 0,
"rejected": 0,
"unsubscribed": 0,
"failed": 0,
"temporaryFailed": 0,
"skipped": 0
}
Did this answer your question?