extension-email-marketing

Installation
SKILL.md

Email — Marketing

Marketing email extension for Caffeine AI.

Overview

This skill adds direct marketing email support with subscriber management, topic-based subscriptions, and unsubscribe links that land on the app's own frontend. The backend mints one unsubscribe token per subscriber and topic (unsubscribeTokens) and handles it through MixinEmailUnsubscribe; the frontend renders the /unsubscribe page, where the recipient clicks a button to unsubscribe. Requires email verification before users can receive marketing emails.

Required Setup Checklist

All six steps are mandatory.

  1. mops dependencies — mops add caffeineai-email-marketing, mops add caffeineai-email-verification and mops add caffeineai-authorization.
  2. Stable state fields — emailSubscribers : EmailSubscribers.State and unsubscribeTokens : UnsubscribeTokens.State (plus the verification states verifiedEmails and verificationTokens), initialised in the migration chain head.
  3. Mixin invocations — include MixinEmailUnsubscribe(emailSubscribers, unsubscribeTokens) and include MixinEmailVerification(verifiedEmails, verificationTokens) in main.mo.
  4. Sending — EmailMarketing.sendMarketingEmail(emailSubscribers, verifiedEmails, unsubscribeTokens, topicId, fromUsername, subject, htmlBody, personalise) sends to every verified subscriber of the topic; the app never assembles the recipient list. sendMarketingEmailTo takes explicit addresses and sends to those of them that are verified subscribers of the topic.
  5. Unsubscribe link — the body should contain {{UNSUBSCRIBE_URL}}; when it is missing an unsubscribe line is appended. Every copy also carries a List-Unsubscribe header pointing at the same page.
  6. Frontend npm package and route — @caffeineai/email-marketing installed, and a public route /unsubscribe (reachable without signing in) that renders a button calling confirm().

CRITICAL: the unsubscribe link is https://<app domain>/unsubscribe?token=…. Without the frontend route the recipient lands on a missing page and cannot unsubscribe, which is a compliance failure.

Installs
24.2K
GitHub Stars
2
First Seen
Apr 4, 2026
extension-email-marketing — caffeinelabs/skills