cratefield-module-email-signup 0.4.4

Cratefield module: email signup with double opt-in, unsubscribe, admin export
Documentation

cratefield-module-email-signup

Email signup for a Cratefield venture: POST /v1/email-signup collects an address, double opt-in via a signed confirmation link, one-click unsubscribe, admin CSV export and hard delete.

use cratefield_module_email_signup::EmailSignup;

let module = EmailSignup::new()
    .double_opt_in(true)
    .confirm_ttl_days(7)
    .retention_days_pending(30);

Composable with cratefield-module-waitlist:

use cratefield_module_email_signup::EmailSignup;

let module = EmailSignup::new().subscribe_on_waitlist_confirm(true);

adds confirmed waitlist addresses to the signup list through the waitlist.confirmed event — no crate dependency between the modules.

Register the mail templates in the venture's src/lib.rs, in the venture's own style: they render through cratefield-mail-templates (ADR 0030) with the MailTheme you give them. default_templates() renders in a theme built from the venture's core Brand and its MAIL_THEME config instead; either way, venture overrides registered later win.

use cratefield_core::Harness;
use cratefield_mail_templates::{MailTheme, Palette};
use cratefield_module_email_signup::themed_templates;

let theme = MailTheme::new("Acme", "https://acme.test")
    .logo("https://acme.test/assets/email/logo-64.png", "Acme")
    .light(Palette::neutral_light().button("#0E1526"));
let builder = Harness::builder().templates(themed_templates(&theme));

See docs/ARCHITECTURE.md section 6 (Email signup) and section 11 (no enumeration, tokens, admin auth, retention).


MIT. Built in the open for Cratefield, a Factory Zero venture.