MailerLintEmail¶
POST mailer/email/lint
Returns warnings, not verdicts: the decision to send stays with the human. The checks are the ones spam filters and mail clients actually react to.
Running it before a campaign is cheaper than reading the bounce report after one.
Access Control¶
Allowed roles: admin, leader.
Request¶
POST https://{broker_domain}/mailer/email/lint
{
"templateId": 4,
"kind": "MARKETING",
"to": "[email protected]"
}
{
"command": "MailerLintEmail",
"extID": "1",
"data": {
"templateId": 4,
"kind": "MARKETING",
"to": "[email protected]"
}
}
const res = await platform.MailerLintEmail({
templateId: 4,
kind: "MARKETING",
to: "[email protected]"
});
Request Data¶
| Field | Type | Required | Description |
|---|---|---|---|
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 |
to |
string | No | Recipient, to render the unsubscribe link |
kind |
enum | No | TRANSACTIONAL or MARKETING |
Behavior¶
- Warning codes:
CLIPPED_BY_GMAIL(over ~102 KB, the footer with the unsubscribe link gets cut off),NO_TEXT_CONTENT,MOSTLY_IMAGES,TEXT_PART_GENERATED,IMAGES_WITHOUT_ALT,NO_UNSUBSCRIBE_LINK,EMPTY_SUBJECT,SUBJECT_TOO_LONG,SUBJECT_ALL_CAPS,SUBJECT_EXCLAMATIONS,SUBJECT_EMOJI_IN_TRANSACTIONAL,EMPTY_LINKS,INSECURE_LINKS,UNRESOLVED_LINKS,IP_LINKS,SPAM_WORDS. ok: truemeans there is nothing to show the operator — not that the email is perfect.
Response Data¶
{
"ok": false,
"warnings": [
{ "code": "CLIPPED_BY_GMAIL", "message": "Email is 118 KB; Gmail clips at about 102 KB", "details": { "bytes": 120832 } },
{ "code": "IMAGES_WITHOUT_ALT", "message": "3 image(s) have no alt text" }
],
"stats": {
"bytes": 120832,
"textLength": 640,
"subjectLength": 44,
"links": 7,
"images": 4,
"imagesWithoutAlt": 3
},
"kind": "MARKETING",
"templateId": 4,
"missingPlaceholders": []
}
Errors¶
| Code | Error | Description |
|---|---|---|
400 |
VALIDATION_ERROR |
No content and no template |
404 |
TEMPLATE_NOT_FOUND |
Template not found in the brand |