@bhooai/nexus-email
v0.1.5
Published
Email providers, a template engine, and a Redis-backed queue.
Readme
@bhooai/nexus-email
Email providers, a template engine, and a Redis-backed queue.
Exports
createEmail(config, { templates })→EmailServicewithsend.- providers — SMTP via
nodemailer; a log provider for dev. PluggableEmailProviderinterface. - TemplateEngine —
register(name, template)+ render with{{var}}interpolation. - queue — Redis-backed send queue (uses
nexus-cachewhen available).
Usage
import { createEmail, TemplateEngine } from '@bhooai/nexus-email';
const templates = new TemplateEngine();
templates.register('welcome', '<h1>Welcome, {{name}}!</h1>');
const email = createEmail(config.email, { templates });
await email.send({ to: '[email protected]', template: 'welcome', vars: { name: 'Ravi' } });