ZH
测试版翻译

@core / newsletter

1.1.0 ▾
已验证MIT
GitHub

邮件订阅:双重确认、一键退订(RFC 8058)、标签以及可续发的批量群发

代码11 个文件上下文约 889 个 token扫描通过

应用 .genpmignore 后将被注入的确切目录树。固定于

src/lib/newsletter/adapters/hono.ts只读 · 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));
}

举报 @core/newsletter

使用 GitHub 登录后才能举报包。