Skip to content

MailerSendTestEmail

POST mailer/email/test

Sends the assembled email to a given address so the layout can be checked in a real mail client.

Suppression and the duplicate window are not applied — the address of whoever is testing may well be suppressed, and they will send themselves the same subject many times. The email is marked isTest and excluded from deliverability reports, so checking a layout does not skew the statistics.

Access Control

Allowed roles: admin, leader.

Request

POST https://{broker_domain}/mailer/email/test
{
  "to": "[email protected]",
  "templateId": 4,
  "data": {
    "name": "John",
    "amount": "250 EUR"
  }
}
{
  "command": "MailerSendTestEmail",
  "extID": "1",
  "data": {
    "to": "[email protected]",
    "templateId": 4,
    "data": {
      "name": "John",
      "amount": "250 EUR"
    }
  }
}
const res = await platform.MailerSendTestEmail({
  to: "[email protected]",
  templateId: 4,
  data: {
    name: "John",
    amount: "250 EUR"
  }
});

Request Data

Field Type Required Description
to string Yes Where to send the test
templateId int No Template to render; use it instead of passing content
subject string No Subject, up to 512 characters
html string No HTML body
text string No Plain-text part; generated from the HTML when omitted
structure array No Email builder tree; the HTML is rendered from it
data object No Placeholder values
profileId int No Explicit provider profile
kind enum No TRANSACTIONAL or MARKETING

Response Data

{
  "emailId": 817,
  "to": "[email protected]",
  "subject": "John, your deposit of 250 EUR is confirmed",
  "isTest": true
}

Errors

Code Error Description
400 INVALID_EMAIL_ADDRESS Address cannot be parsed
400 VALIDATION_ERROR No content and no template
404 NOT_FOUND Template or profile not found
409 NO_ROUTE_AVAILABLE No profile of the brand can send to this address