Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

mailersend-webhooks

БесплатноЗапускает вложенные скриптыНе проверен

Receive and verify MailerSend webhooks. Use when setting up MailerSend webhook handlers, debugging MailerSend signature verification with the `Signature`…

hookdeckот hookdeck★ 104 звезды на GitHub

Об этом скилле

MailerSend Webhooks

When to Use This Skill

  • How do I receive MailerSend webhooks?
  • How do I verify a MailerSend webhook signature?
  • Why is my MailerSend Signature header verification failing?
  • Why won't my MailerSend webhook save / why does the URL validation fail?
  • What is webhook.test and the test_Am3L1GuOIc4blLUuHqAPxxwkZaJyEk8G secret?
  • How do I handle activity.hard_bounced / activity.spam_complaint events?
  • How do I handle MailerSend SMS webhooks (sms.sent, sms.delivered, sms.failed)?

MailerSend, not MailerLite. MailerSend is the transactional email and SMS API from the MailerLite group (developers.mailersend.com). MailerLite (marketing email) is a separate product with a separate webhook scheme. This skill is not for Mailgun, Mailchimp or Resend either.

Verification (core)

Signature: <lowercase hex HMAC-SHA256 of the RAW request body>, keyed with the per-webhook Signing Secret. No timestamp, no nonce, no version prefix, no field concatenation — the header value is the bare digest.

const crypto = require('crypto');

// MailerSend signs its URL-validation ping with this FIXED, PUBLICLY DOCUMENTED
// secret — not your signing secret. Accept it, but only for `webhook.test`.
const MAILERSEND_TEST_SECRET = 'test_Am3L1GuOIc4blLUuHqAPxxwkZaJyEk8G';

function verifySignature(rawBody, signature, secret) {
  if (!signature || !secret) return false;
  const expected = crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
  const a = Buffer.from(String(signature).trim().toLowerCase(), 'utf8');
  const b = Buffer.from(expected, 'utf8');
  // timingSafeEqual THROWS on a length mismatch — guard the length first
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

// rawBody MUST be the exact bytes received. Re-serialising parsed JSON breaks it.
const signature = req.header('Signature');
const signedByYou = verifySignature(rawBody, signature, process.env.MAILERSEND_WEBHOOK_SECRET);
const signedByPing = !signedByYou && verifySignature(rawBody, signature, MAILERSEND_TEST_SECRET);
if (!signedByYou && !signedByPing) return res.status(401).send('Invalid signature');
// After parsing: if signedByPing, require type === 'webhook.test' — the test
// secret is public, so it must never authorise a real event.

For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.

The official Node SDK (mailersend) ships MailerSendUtils.verifyWebHook(rawBody, headersOrSignature, signingSecret), exported from the package entry point in current releases (3.9.0). It reads the Signature header, guards the length before timingSafeEqual, and works for email, SMS and WhatsApp webhooks. It throws when the body, header or secret is missing, so wrap it in try/catch and answer 401. Verifying manually, as above, is equivalent. See references/verification.md.

The webhook.test Ping (read this before your first webhook fails to save)

When you create or update an email or SMS webhook, MailerSend immediately calls the URL to validate it. If that request does not get a 2xx, the webhook is not saved.

{
  "type": "webhook.test",
  "message": "This is a ping test message",
  "created_at": "2026-03-27T07:24:20.577080Z"
}

Two traps:

  1. Different envelope. It carries message, not data. Code that does payload.data.id unconditionally will 500 on the ping.
  2. Different secret. It is signed with the fixed, publicly documented test_Am3L1GuOIc4blLUuHqAPxxwkZaJyEk8G, not your webhook's signing secret. A handler that only checks the real secret rejects the ping and the webhook never saves.

Because that secret is public, anyone can forge a valid webhook.test. Accept it, return 200, and never let it gate privileged work.

Payload Envelope

Real events:

{
  "type": "activity.sent",
  "created_at": "2025-08-05T21:23:54.000000Z",
  "data": {
    "id": "6892766a5b66e2daf3dc9155",
    "domain_id": "yv69oxl5kl785kw2",
    "message_id": "6892766ae78995a317577aa1",
    "email_id": "6892766a8d52ba62543d5e71",
    "type": "sent",
    "subject": "Test email",
    "recipient": "[email protected]",
    "tags": ["test", "test2"],
    "meta": []
  }
}
  • This is the version 2 payload. Email webhooks have a version setting: version 1 (nested data.email object) stops working on December 1, 2026. Dashboard webhooks default to 2, but the create-webhook API still defaults to 1, so send "version": 2. A version 2 webhook can't go back to 1.
  • data.type is the bare activity name (sent), without the activity. prefix. The unique events print the non-unique word (opened, clicked).
  • data.meta is an empty ARRAY [] when there is nothing to report, and an object otherwise. This breaks naive typed dese
Полный SKILL.md на GitHub

Установить mailersend-webhooks в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/express/.env.exampleexamples/express/README.mdexamples/express/package.jsonexamples/express/src/index.jsexamples/fastapi/.env.exampleexamples/fastapi/README.mdexamples/fastapi/main.pyexamples/fastapi/requirements.txtexamples/fastapi/test_webhook.pyexamples/nextjs/.env.exampleexamples/nextjs/README.mdexamples/nextjs/app/webhooks/mailersend/route.tsexamples/nextjs/package.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

Что делает скилл mailersend-webhooks?

Receive and verify MailerSend webhooks. Use when setting up MailerSend webhook handlers, debugging MailerSend signature verification with the `Signature` header (HMAC-SHA256 hex over the raw body), handling the `webhook.test` URL validation ping, or handling MailerSend activity events like activity.sent, activity.delivered, activity.hard_bounced, activity.opened, activity.clicked and activity.spam_complaint. Also covers MailerSend SMS webhooks (sms.sent, sms.delivered, sms.failed) and WhatsApp webhooks (whatsapp.delivered, whatsapp.inbound and others). MailerSend is the transactional email/SMS API — not MailerLite, Mailgun, Mailchimp or Resend.

Как установить скилл mailersend-webhooks?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл mailersend-webhooks запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить mailersend-webhooks с