Go-Mailer.

Transactional Emails

The Transactional Email Object represents a transactional email template in your Go-Mailer account. The API allows you to send or dispatch transactionals to your contacts.

Send an email

Sends the specified transactional email to the specified recipients. A recipient does not have to be a contact in your account.

POST https://api.go-mailer.com/v1/transactionals

Request body

template_code - string - required

The transactional template's unique code.

recipient_email - string - required

The email address of the recipient.

bcc - string

The email address to blind copy.

html - string

A valid HTML document, for the event where you would like to use your own predesigned or pregenerated HTML markup as the email content. This will override the design you created in your Go-Mailer account.

data - object

A key => value set of information which will be used to replace any placeholders specified in the transactional email.

The key should be the name of the placeholder used. e.g: if you used @firstname placeholder in your template, then your data object should look like this { firstname: "Sample Name" }

attachments - object[]

This is a list of attachments to be sent via the transactional. Each attachment MUST NOT be more than 1MB.

attachment.filename - string

This is the name of the attachment as it should be displayed to the recipient.

attachment.path - string

The link to the file if the attachment is hosted on a remote server.

attachment.content - string

This is a base64 representation of the attachment. This is best where the attachment is not hosted remotely.

attachment.contentType - string

This is the mimetype of the attachment. The supported values include: application/pdf

attachment.encoding - string

This is the attachment's content encoding. This should be base64

Sample request

HTTPNode.jsPythonPHP
const response = await fetch("https://api.go-mailer.com/v1/transactionals", {
  method: "POST",
  headers: {
    Authorization: "Bearer <API_KEY>"
  },
  body: JSON.stringify({
    template_code: "BIRTHDAY_EMAIL",
    recipient_email: "johndoe@example.com",
    bcc: "admin@my-company.com",
    data: {
      firstname: "John",
      age: 47,
    },
    attachments: [{
      filename: "yourfile.pdf",
      path: "https://path/to/file",
    }]
  })
});