The AntelopeJS contract for email. Send templated, batch and attachment emails without naming a provider.
Documentation · Implementations · All interfaces and providers
The AntelopeJS contract for sending email: one API for single, batch and template messages, whatever provider delivers them.
Sendsends one message with text or HTML, recipients, threading headers and attachments.SendBatchsends several messages in one call, with shared defaults.SendTemplaterenders a provider template or an inline template with variables.GetCapabilitiesreports what the provider supports, such as scheduling or tracking.SendandSendTemplatereturn a status, an optional provider message ID, and optional error details.SendBatchreturns totals and one result per message.GetCapabilitiesreturns provider features and limits, not delivery results.
| Module | Notes |
|---|---|
@antelopejs/nodemailer |
SMTP through Nodemailer |
@antelopejs/brevo |
Brevo HTTP API |
Add the interface to the module that sends email:
pnpm add @antelopejs/interface-emailThen add an implementation to the project:
ajs project modules add @antelopejs/nodemailerimport { Send } from "@antelopejs/interface-email";
export async function sendWelcome(address: string) {
const response = await Send({
to: address,
subject: "Welcome aboard",
html: "<p>Thanks for joining.</p>",
text: "Thanks for joining.",
});
if (!response.success) {
throw new Error(response.error?.message);
}
return response.messageId;
}| Package | Supported | Tested with |
|---|---|---|
@antelopejs/interface-core |
>=0.5.1 <0.6.0 |
0.5.1 |
The table repeats the peer range in package.json. The package declares no
@antelopejs/core peer range, so check the requirements of the implementing module too.
Read CONTRIBUTING.md before you open a pull request. The local checks are:
pnpm install
pnpm lint
pnpm buildThis package belongs to AntelopeJS, the TypeScript framework where modules depend on contracts and the application chooses the provider. The open-source back office AntelopeJS DMS is built on it.
| Area | Contracts | Providers |
|---|---|---|
| API | interface-api · interface-api-util · interface-data-api |
api |
| Auth | interface-auth |
auth-jwt |
| Database | interface-database · interface-database-decorators · interface-database-catalog · interface-mongodb · interface-rethinkdb |
postgres · mysql · mongodb · rethinkdb |
| Redis | interface-redis · interface-redis-scheduler |
redis |
interface-email |
nodemailer · brevo |
|
| File storage | interface-file-storage |
file-storage-local · file-storage-s3 |
| Payments | interface-payment · interface-subscriptions · interface-stripe |
stripe · mollie · checkout-com · payment-subscriptions |