EN

@core / newsletter

1.1.0 ▾
verifiedMIT
GitHub

Newsletter: double opt-in, one-click unsubscribe (RFC 8058), tags, rich-text campaigns sent in resumable batches

Code11 filesContext~889 tokensscan passed

The exact tree that will be injected, after .genpmignore. Pinned to

src/lib/newsletter/adapters/hono.tsread-only · 48a34fe
// Adaptador Hono: `app.route('/newsletter', newsletterRoutes())`.
import { Hono } from 'hono';
import { handleConfirm, handleSubscribe, handleUnsubscribe, type NewsletterPages, type NewsletterPageTexts } from './http.ts';

export function newsletterRoutes(opts: { pages?: Partial<NewsletterPages>; texts?: Partial<NewsletterPageTexts>; tags?: string[] } = {}) {
  return new Hono()
    .post('/subscribe', (c) => handleSubscribe(c.req.raw, { tags: opts.tags }))
    .get('/confirm', (c) => handleConfirm(c.req.raw, opts.pages, opts.texts))
    .post('/confirm', (c) => handleConfirm(c.req.raw, opts.pages, opts.texts))
    .get('/unsubscribe', (c) => handleUnsubscribe(c.req.raw, opts.pages, opts.texts))
    .post('/unsubscribe', (c) => handleUnsubscribe(c.req.raw, opts.pages, opts.texts));
}

Report @core/newsletter

Sign in with GitHub to report a package.