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

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

40 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

@antelopejs/interface-email

npm License Discord Docs

The AntelopeJS contract for sending email: one API for single, batch and template messages, whatever provider delivers them.

Part of AntelopeJS. Used by AntelopeJS DMS, the open-source back office for your PostgreSQL, MongoDB or RethinkDB database.

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.2.4 <1.0.0 0.2.4

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

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

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages