How can I apply extra contact fields while sending an email through REST API?

Introduction

Imagine you want to send an Abandoned Shopping Cart mailing. When consumers place items in their shopping cart on your website but do not complete the checkout, you can send them a reminder.

Such mailings often rely on temporary, irrelevant data that you don’t want to permanently store in your database. In Spotler MailPro, it is possible to include Extra Contact Data in your emails without saving it in the database.

This article explains how to achieve this using a generic example of a transaction that was not completed. Of course, Extra Contact Data can also be applied to other types of mailings.


Requirements

To send Extra Contact Data, you need an API connection. Usually this is done via REST API.

Available API calls

/{campaignId}/contact/sendSingleMail
/{campaignId}/mailing/{id}/sendSingle
/{campaignId}/contacts/send

Example: sendSingle call with Extra Contact Data (REST)

Below is an example of what a sendSingle call with Extra Contact Data looks like in REST:

{
  "contactId": 2,
  "attachments": [
  ],
  "extraContactData": [
    {
      "field": "DMD_hotel_name",
      "value": "Hotel Example"
    },
{
      "field": "DMD_checkin_date",
      "value": "01-01-2026"
    },
{
      "field": "DMD_checkout_date",
      "value": "07-01-2026"
    },
{
      "field": "DMD_checkout_url",
      "value": "https://spotler.com/checkout/example/12345678910"
    }
  ]
}

Display in Spotler MailPro

Drag&Drop Editor (most used)

dmd_fields.png

Result in the inbox

The extra information defined in your API call is correctly populated in the email:

dmd_fields_result.png

Important notes

  • You can name the Extra Contact Fields yourself, but they must always start with DMD_ in order to be recognized by Spotler MailPro.

  • If you want to send over HTML data, ensure to extend your variable with |raw.

  • These fields cannot be shown in the web version of the email.
    Therefore, do not link to the web version when using Extra Contact Data.