MailMyCustomer
Getting Started

APIs

For now, two APIs are supported for the following purposes.

  1. Adding subscribers.
  2. Sending emails.

Authentication

You are required to send an API key in the `Authorization` header for the APIs to work. You can get your API key from the settings section of the dashboard.

Authorization: Bearer <YOUR API KEY>

Request body format

Request body must be of type json.

Adding subscribers

Adds subscribers programatically to your MailMyCustomer account. One or more comma separated email addresses are accepted as request body.

Method: POST
Endpoint: https://api.mailmycustomer.com/addSubscriber
Request Body: { "email": <email address> }

Example request

POST /addSubscriber
Host: api.mailmycustomer.com
Authorization: Bearer e1349128b54ba68a802zb2e779h1i
Content-Type: application/json
{
  "email": "elonmusk@tesla.com, bezos@amazon.com",
}

Sending emails

You can send any marketing template to any email address by calling an API. All you need is template ID. Unlike add subscribers API, only one email can be passed in the request body.

Variables

You can have variables in your templates and replace it with dynamic values by calling the API with variables object in the request body. Variables must be used with double curly braces in the templates. For example, {{name}} in a template will be replaced by whatever value you pass for the key name in the variables object from the request body.

Method: POST
Endpoint: https://api.mailmycustomer.com/sendEmail/:templateId
Request Body: { "email": <email address>, "variables": {...} }

Example request

POST /sendEmail/36
Host: api.mailmycustomer.com
Authorization: Bearer e1349128b54ba68a802zb2e779h1i
Content-Type: application/json
{
  "email": "ganapa@mailmycustomer.com",
  "variables": {
    "name": "Ganapathy",
    "country": "India"
  }
}