SendPulse Email Service Skill
You are helping a user run email marketing campaigns through SendPulse Email
Service: mailing lists, subscribers, segments, campaigns, and analytics. This file is
the core playbook; detailed material lives in references/ and examples/. Load a
reference file only when the task needs it.
Step 0 — Route to the right skill/product first
SendPulse email work splits across three skills. Never duplicate the other two — hand over instead:
| User goal | Use |
|---|---|
| Build/code the HTML of the email, subject lines, copy, template design | sendpulse-template-skill (install it if missing) — this skill does NOT write email HTML |
| One email per app event: order confirmation, password reset, alert | sendpulse-smtp-skill / SMTP API |
| Lists, subscribers, segments, campaigns, scheduling, A/B, campaign analytics | this skill |
Two rules that follow from this split:
- When the user needs an email designed AND sent as a campaign: template skill builds the HTML → this skill uploads it as a template and runs the campaign.
- If the user loops over their list calling the SMTP send endpoint — stop them; that is what campaigns are for (cheaper, aggregated stats, automatic unsubscribe handling, no rate-limit burn).
Adjacent SendPulse products to mention (pointer only, not covered here): Automation 360 (triggered flows), subscription forms, Email Verifier (validate old lists before sending), CRM.
Step 1 — Pick the channel and authorize
MCP first, when available. If the user's AI client supports MCP, connecting the
hosted SendPulse MCP server (https://mcp.sendpulse.com/mcp) lets you drive
books, contacts, and campaigns through tools directly from chat — no API code. Check
the session for email_* SendPulse tools; if present (or the user is open to a
one-time setup), follow references/sendpulse-mcp.md. For apps/integrations that
run on their own, use the REST API below.
Base URL: https://api.sendpulse.com. Two options; prefer the Single API Key:
- Single API Key (preferred) — long-lived Bearer token generated manually in
Settings → API → API keys (up to 5 keys; revocable). No refresh logic:
Authorization: Bearer <API_KEY>on every request. - OAuth client credentials (alternative) —
POST /oauth/access_tokenwith{"grant_type":"client_credentials","client_id":"...","client_secret":"..."}; token lives 1 hour, cache it and refresh on 401.
Never hardcode keys/secrets — env vars or a secrets manager only.
Step 2 — The campaign lifecycle (the mental model)
Address book → subscribers (+variables) → [segment] → campaign → moderation →
scheduled/sending → sent → analytics → act on the results
Minimal happy path (details in references/quickstart.md):
POST /addressbooks{"bookName": "Customers"}→ getid.POST /addressbooks/{id}/emailswith subscribers and their variables.POST /campaignswithsender_name,sender_email(a verified sender),subject,body(Base64-encoded HTML) ortemplate_id,list_id.GET /campaigns/{id}— watch the status; then read the stats.
Critical rules — the top sources of confusion and bugs
bodymust be Base64-encoded HTML. Same forattachments_binarycontent and theemailsparameter of the blacklist endpoints.sender_emailmust be a verified sender (confirmed via code/email, on a corporate domain — free mailbox domains are rejected).GET /senderslists them.- Campaigns can be held for review. SendPulse's anti-abuse system reviews campaigns; the first campaigns from a new account are routinely moderated — this is normal, usually resolves in hours, and is not an error. Tell users to plan a time buffer for their first sends and not to schedule a critical first campaign minutes before a deadline.
- Rate limit: max 4 campaigns per hour, and up to 10 address books per campaign (segmented and test campaigns: exactly 1 book).
- Check the price before sending:
GET /addressbooks/{id}/cost. Attachments increase the cost. If the balance/plan can't cover the list, the campaign won't go out. - Always send a test first: create with
"is_test": trueor send to a test book with the team's addresses. For rendering checks, use the dashboard's preview and spam-check tools. - Scheduling:
send_dateinY-m-d H:i:s. A scheduled campaign can be edited (PATCH /campaigns/{id}) or cancelled (DELETE /campaigns/{id}) until it starts sending. Gotcha: if the sender domain enforces a strict DMARC policy, scheduling may be unavailable and the campaign is sent immediately. - Enable tracking:
"stats": {"opens": true, "clicks": true, "utm_campaign": "..."}— without it there is nothing to analyze afterwards, and "resend to unopened" won't work.
Full campaign features (statuses, A/B tests, resend to unopened, best-time sending,
timezone sending, drafts): references/campaigns.md.
Step 3 — Work the list, not just the blast
Good senders treat the list as the product. Bake these habits into any integration:
- Only opt-in addresses. Never import purchased/scraped lists — they contain spam
traps and dead addresses, tank deliverability, and will get the account blocked.
For old or doubtful lists, run them through SendPulse Email Verifier first.
→
references/list-building.md - Use variables (
string/number/date) on subscribers for personalization ({{name}}) and segmentation. Date format isYYYY-MM-DD. →references/address-books.md - Segment instead of blasting. Built-in presets: new subscribers, active
(opened recently), inactive. Sending everything to everyone is the #1 cause of
unsubscribes and spam complaints. →
references/segmentation.md - Respect statuses. Unsubscribed/invalid addresses are excluded automatically —
never try to re-add them to force delivery. Account-wide suppression =
/blacklistendpoints.
Step 4 — Read the results and act
After every campaign, pull the stats (GET /campaigns/{id}, country/link breakdowns,
per-subscriber opens/clicks) and interpret them with the playbook in
references/analytics.md: which metric is off → what to change next time (subject,
segment, content, list hygiene, send time). Real-time events (delivered, opened,
clicked, spam, unsubscribed, bounces) are available via webhooks →
references/webhooks.md.
Troubleshooting — diagnose in this order
"My campaign is not sending / something failed" — walk top-down; the full status and
error tables are in references/errors.md:
- Auth OK? (401 → key/token problem)
GET /campaigns/{id}— read the status: on review → wait, it's normal (especially for new accounts); draft → it was never launched; cancelled/blocked → see errors.md; insufficient funds → top up or shrink the segment.- Sender verified? Body Base64?
list_idvalid and the book has active addresses? - Hit the 4-campaigns/hour limit or a scheduling conflict?
- Sent but poor results →
references/analytics.md.
Official SDKs
Prefer plain HTTP examples for clarity; mention the official libraries when the stack
matches: PHP,
Python,
Node.js. Code samples:
examples/curl.md, examples/php.md, examples/python.md, examples/nodejs.md.
Keeping this skill up to date
This skill is versioned (frontmatter above + the VERSION file). If you have web
access, you MAY check once per conversation when the skill is first used:
- Fetch
https://raw.githubusercontent.com/sendpulse/sendpulse-skills/main/sendpulse-email-skill/VERSION - Compare with the local version (semver).
- If newer, tell the user an update is available (
git pullin the sendpulse-skills clone or re-download from https://github.com/sendpulse/sendpulse-skills/tree/main/sendpulse-email-skill) — then continue with the current version.
Never block the user's task on the version check; skip silently without web access. When this skill and the live docs at https://sendpulse.com/integrations/api/bulk-email?utm_source=ai-agent&utm_medium=skill&utm_campaign=ai-skills&utm_content=sendpulse-email-skill disagree, the live documentation wins — say so and prefer it.
