outbox

Send emails.

Syntax

var outbox = require('outbox');

Load the outbox module.

Description

Send emails by adding them to the transaction’s outbox.

Transactions can start child transactions. When a child transaction finishes successfully, the emails in its outbox are appended the outbox of its parent transaction. When a child transaction fails, the emails in its outbox are dropped.

Each application has full control over its outbox to simplify testing.

Child transactions are always started with an empty outbox. Thus, a child transaction can not access emails added to its parent transaction’s outbox.

Examples

Add an email to the outbox.

Count emails in the outbox.

Prevent sending email.