@tupaca/bull-mailer
v0.0.2
Published
A lightweight Node.js library that queues and sends emails using Bull (with Redis) and Nodemailer. It enables asynchronous, reliable email delivery by offloading the sending process to a background queue.
Downloads
27
Readme
@tupaca/mailer
Este proyecto es un servicio de envío de correos electrónicos utilizando Nodemailer y Redis.
Instalación
npm install @tupaca/bull-maileryarn add @tupaca/bull-mailerScripts
build: Compila el proyecto TypeScript.
start: Inicia el proyecto.
test: Ejecuta las pruebas.Inicializacion
import { initializeMailer } from "@tupaca/bull-mailer";
const config: MailerConfig = {
nodemailer: {
host: "smtp.example.com",
port: 587,
pool: true,
maxConnections: 3,
maxMessages: 1
auth: {
user: "[email protected]",
pass: "password",
},
},
redis: {
path: "redis://localhost:6379",
port: 6379,
},
};
initializeMailer(config);Envio de mail
import { sendEmail } from "./src/mailer";
import { EmailOptions } from "./src/types";
const emailOptions: EmailOptions = {
to: "[email protected]",
from: "[email protected]",
subject: "Asunto del correo",
text: "Contenido del correo",
html: "<p>Contenido del correo</p>",
};
sendEmail(emailOptions);Este README.md proporciona una visión general del proyecto, cómo instalarlo, configurarlo y usarlo. Puedes ajustarlo según tus necesidades específicas.
