Newsletter and notifications
Subscribe audiences through Resend or Beehiiv and send operational messages through Discord or Feishu.
Newsletter contract
The newsletter module exposes three operations:
- subscribe;
- status;
- unsubscribe.
The same page and API work with Resend Contacts or Beehiiv. Waitlist and signup flows call the stable operations rather than a vendor SDK.
Select a newsletter provider
VITE_NEWSLETTER_PROVIDER=resendUse beehiiv for the alternate adapter.
Preview mode
NEWSLETTER_PREVIEW=trueThe preview adapter stores deterministic subscription state so end-to-end tests can join, query, and unsubscribe without a vendor account.
Waitlist integration
A first waitlist join can subscribe the selected newsletter provider and send a welcome email. The waitlist remains the durable source of queue position and referral state in D1.
Notification contract
Discord and Feishu adapters receive bounded text through one sendNotification operation. Admin can choose a provider and exercise the integration from the product UI.
NOTIFICATION_PREVIEW=truePreview mode confirms the request locally. Production requires the selected webhook URL.
Operational guidance
- Keep audience status cache in KV and queue state in D1.
- Provide a working unsubscribe path.
- Never send administrator-only data through a public notification endpoint.
- Rate-limit automated notification sources when you add them.