PT

@core / newsletter

1.1.0 ▾
verificadoMIT
GitHub

Newsletter: double opt-in, descadastro em um clique (RFC 8058), tags e campanhas em lotes retomáveis

Código11 arquivosContexto~889 tokensanálise aprovada

A árvore exata que será injetada, após o .genpmignore. Fixada em

src/lib/newsletter/adapters/hono.tssomente leitura · 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));
}

Denunciar @core/newsletter

Entre com o GitHub para denunciar um pacote.