CleverTap
CleverTap decides who gets which campaign and when. Anypost sends it. Add Anypost as a Generic HTTP email provider in CleverTap and every campaign sends from your verified domain, while deliveries, bounces, complaints, and unsubscribes flow back into CleverTap's reports and profiles.
CleverTap's Generic HTTP provider is in private beta. Ask your CleverTap account team to enable it for your account.
Before you start
- A verified sending domain for the addresses your campaigns send from.
- An Anypost API key. A
send_onlykey is enough. See Authentication. - Generic HTTP enabled in your CleverTap account.
Connect CleverTap
- In CleverTap, start adding a Generic HTTP email provider and copy the callback URL it shows.
- In the Anypost dashboard, open Integrations, then CleverTap, and paste the callback URL. This is where Anypost sends events. One CleverTap account per team.
- Back in CleverTap, fill in the provider setup:
| Setting | Value |
|---|---|
| Endpoint | https://api.anypost.com/v1/integrations/clevertap/email |
| Method | POST |
| Authentication | None |
| Headers | Authorization: Bearer <your API key> and Content-Type: application/json |
| Body | The template below |
| Batch | Off, unless you can set the batch size. See Batching |
Mail sends as soon as CleverTap is set up. Events reach CleverTap only once step 2 is done, so finish both sides before your first campaign.
Body template
Paste this as the request body. CleverTap replaces each $$ placeholder per
message.
{
"to": "$$To",
"message_id": "$$MessageID",
"campaign_id": "$$CampaignID",
"from_name": "$$FromName",
"from_address": "$$FromAddress",
"reply_to": "$$ReplyToAddress",
"subject": "$$Subject",
"html": "$$HTML",
"text": "$$Plaintext"
}An empty placeholder counts as not set, so optional fields can stay in the template.
| Field | Placeholder | |
|---|---|---|
to | $$To | Required. One recipient per message. |
message_id | $$MessageID | Required. CleverTap matches every event to its message by this value. |
from_address | $$FromAddress | Required. Must be on a verified domain. |
from_name | $$FromName | |
subject | $$Subject | Required. |
html, text | $$HTML, $$Plaintext | At least one is required. |
reply_to | $$ReplyToAddress | |
campaign_id | $$CampaignID | Becomes the email's campaign. |
subscription_group | a custom key | See Subscription groups. |
ip_pool | a fixed value | A dedicated IP pool on your team. |
A field you set at the top level of a batched body applies to every message that leaves it empty.
Subscription groups
Add a custom $$SubscriptionGroup key to your CleverTap campaign and a
"subscription_group": "$$SubscriptionGroup" line to the template. Each
message then carries a one-click List-Unsubscribe header scoped to that
group, which Gmail and Yahoo require on marketing mail. The group also becomes
the email's topic, lowercased with spaces and
punctuation turned into -: Plant Care Tips becomes plant-care-tips.
A recipient who unsubscribes from one group stops getting that group from
Anypost. CleverTap isn't told, because CleverTap's only unsubscribe event
removes the profile from all email. A recipient who unsubscribes from
everything is reported to CleverTap as unsubscribed. See
Unsubscribe.
What CleverTap receives
| Anypost event | CleverTap event | Effect in CleverTap |
|---|---|---|
email.delivered | delivered | Notification Delivered |
email.bounced, permanent | hard_bounce | Notification Failed; unsubscribes the profile from all email |
email.bounced, temporary or expired | soft_bounce | Notification Failed |
email.complained | spam | Unsubscribes the profile from all email |
email.unsubscribed, from all email | unsubscribed | Unsubscribes the profile from all email |
email.suppressed | by reason: hard_bounce, spam or unsubscribed | As above |
Sent, delayed, opened, and clicked events aren't reported. CleverTap has no open event, so keep CleverTap's own click tracking on for click reporting.
Some bounces arrive later by email instead of during delivery, and spam
complaints come from mailbox providers' feedback loops. Neither can be tied to
the original message. Anypost adds the address to your
suppression list, and CleverTap learns of it on the next
campaign to that address, which Anypost blocks and reports as
email.suppressed. Addresses you suppress by hand are never reported, since
that would unsubscribe the profile from all email.
Anypost retries event deliveries that fail, and CleverTap doesn't remove duplicates, so a retried delivery can count an event twice in CleverTap's reports.
Batching
CleverTap batches up to 1,000 messages per request. Anypost accepts up to 100
per request, and 5 MB in total. If your CleverTap account lets you set the
batch size, set it to 100 or fewer and wrap the template in a msgs array:
{
"msgs": [
{ "to": "$$To", "message_id": "$$MessageID", "…": "…" }
]
}Otherwise leave batching off. Each email is then one request, which counts toward your plan's per-second rate limit.
Where to go next
- Domains & DNS setup: verify the domain your campaigns send from.
- Suppressions: the list that keeps bounced and unsubscribed addresses from being mailed.
- Sending limits: the daily and monthly limits every send counts toward.