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 |
|---|---|
| HTTP Endpoint | https://api.anypost.com/v1/integrations/clevertap/email |
| Request Type | POST |
| Authentication | No Authentication |
| Headers | Authorization: Bearer <your API key> and Content-Type: application/json |
| Parameters | The JSON below |
| Batch parameter | On, named msgs, size 100. 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.
Parameters JSON
Paste this into the Parameters tab. CleverTap replaces each $$
placeholder per message and repeats the entry inside msgs once per email in
the batch.
{
"campaign_id": "$$CampaignID",
"msgs": [
{
"to": "$$To",
"message_id": "$$MessageID",
"from_name": "$$FromName",
"from_address": "$$FromAddress",
"reply_to": "$$ReplyToAddress",
"subject": "$$Subject",
"html": "$$HTML",
"text": "$$Plaintext"
}
]
}Keep the layout as shown: CleverTap accepts $$CampaignID only at the top
level and the sender placeholders only inside msgs. A placeholder CleverTap
leaves empty or unfilled 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 at the top level applies to every message in the batch.
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, address rejected | hard_bounce | Notification Failed; unsubscribes the profile from all email |
email.bounced, permanent, message rejected for content, sending IP, policy or authentication | soft_bounce | Notification Failed |
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, from all email | by reason: hard_bounce, spam or unsubscribed | As above |
email.suppressed, by hand or from one subscription group | soft_bounce | Notification Failed |
| An email Anypost refused, invalid address | hard_bounce | Notification Failed; unsubscribes the profile from all email |
| An email Anypost refused, any other reason | soft_bounce | Notification Failed |
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, and recipients who
unsubscribed from one subscription group, are reported as soft_bounce: the
email fails without unsubscribing 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
Turn on Batch parameter in CleverTap's provider setup, name it msgs, and
set it to 100. CleverTap then sends up to 100 emails per request instead of
one. With batching off, paste the object inside msgs into Parameters, with
campaign_id beside its other fields: each
email is then one request, which counts toward your plan's per-second
rate limit.
Two limits apply to every request:
- 100 emails. A larger batch is rejected.
- 5 MB in total. At 100 emails that leaves about 45 KB per email, HTML and
plain text together. If your emails are larger, lower the batch size to
about 4,500 divided by the size of one email in KB:
60for 75 KB emails.
An email Anypost refuses is reported on its own, with the reason as the failure description, and the rest of the batch sends. Reasons include an invalid recipient address, a sender domain that isn't verified, and a missing subject or body.
A request Anypost can't accept at all fails every email in it, and CleverTap
counts each one as bounced: a wrong API key, invalid JSON, a batch over either
limit, a template with no message_id or to, or a request over your plan's
rate limit or monthly sending 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.