Skip to content

About

The AntelopeJS contract for email. Send templated, batch and attachment emails without naming a provider.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

56 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

INTERFACE · EMAIL: part of AntelopeJS, hexagonal architecture beyond your own code. A glowing button reads Star AntelopeJS.

@antelopejs/interface-email

npm License Discord Documentation Star AntelopeJS

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.

What it offers

  • Send sends one message with text or HTML, recipients, threading headers and attachments.
  • SendBatch sends several messages in one call, with shared defaults.
  • SendTemplate renders a provider template or an inline template with variables.
  • GetCapabilities reports what the provider supports, such as scheduling or tracking.
  • Send and SendTemplate return a status, an optional provider message ID, and optional error details. SendBatch returns totals and one result per message. GetCapabilities returns provider features and limits, not delivery results.

Implementations

Module Notes
@antelopejs/nodemailer SMTP through Nodemailer
@antelopejs/brevo Brevo HTTP API

Install

Add the interface to the module that sends email:

pnpm add @antelopejs/interface-email

Then add an implementation to the project:

ajs project modules add @antelopejs/nodemailer

Quick start

import { 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;
}

Documentation

Compatibility

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.

Contributing

Read CONTRIBUTING.md before you open a pull request. The local checks are:

pnpm install
pnpm lint
pnpm build

Part of AntelopeJS

This 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
Email 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

License

Apache-2.0

About

The AntelopeJS contract for email. Send templated, batch and attachment emails without naming a provider.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages