@antelopejs/nodemailer
v0.0.5
Published
Nodemailer implementation of the AntelopeJS email interface
Readme
@antelopejs/nodemailer
Nodemailer implementation of the AntelopeJS email interface. It sends single or batched messages through SMTP, supports inline templates and attachments, and can create an Ethereal test account for local development.
Installation
pnpm add @antelopejs/nodemailerThe module implements
@antelopejs/interface-email.
Configuration
Add the module to antelope.config.ts:
import { defineConfig } from "@antelopejs/interface-core/config";
export default defineConfig({
name: "my-app",
modules: {
email: {
source: {
type: "package",
package: "@antelopejs/nodemailer",
},
config: {
host: "smtp.example.com",
port: 587,
secure: false,
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASSWORD,
},
defaults: {
from: "[email protected]",
},
},
},
},
});When secure is omitted, port 465 enables it automatically. Authentication is
optional for SMTP servers that do not require it.
For local development, replace the SMTP options with ethereal: true. The
module creates a temporary Ethereal account and logs its address.
Usage
Use the provider-independent email interface from application modules:
import { Send } from "@antelopejs/interface-email";
const result = await Send({
from: "[email protected]",
to: "[email protected]",
subject: "Welcome",
text: "Your account is ready.",
html: "<p>Your account is ready.</p>",
});The implementation also supports SendBatch, inline SendTemplate calls,
attachments, reply headers, and message priorities. Provider-hosted templates
are not supported by Nodemailer.
Development
pnpm install
pnpm lint
pnpm format:check
pnpm testSee the organization-wide contribution guidelines and security policy.
License
Apache-2.0
