@travetto/email
Email transmission module.
Last updated 23 days ago by arcsine .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @travetto/email 
SYNC missed versions from official npm registry.

Email

Email transmission module.

Install: @travetto/email

npm install @travetto/email

A standard API for sending and rendering emails. The mail transport must be defined to allow for mail to be sent properly. Out of the box, the only transport available by default is the NullTransport which will just drop emails. The structure of the API is derived from nodemailer, but is compatible with any library that can handle the MessageOptions input.

To expose the necessary email transport, the following pattern is commonly used:

Code: Declaring the null transport for development

import { InjectableFactory } from '@travetto/di';
import { NullTransport } from '@travetto/email/src/transport';

class Config {
  @InjectableFactory()
  static getTransport() {
    return new NullTransport();
  }
}

Given the amorphous nature of transports, the transport field in MailConfig is open for any configuration that you may want there. Additionally, the templating engine is optional. The code will only fail if you attempt to send a templated email without declaring the dependency first.

Nodmailer - Extension

Due to the connection with nodemailer, all extensions should be usable out of the box. The primary nodemailer modules are provided (assuming dependencies are installed):

Code: sendmail to send all messages via the sendmail operation

import { NodemailerTransport } from '@travetto/email';
import { InjectableFactory } from '@travetto/di';

class Config {
  @InjectableFactory()
  static getTransport() {
    return new NodemailerTransport(require('nodemailer-sendmail-transport'));
  }
}

Code: smtp to send all messages via the smtp operation

import { NodemailerTransport } from '@travetto/email';
import { InjectableFactory } from '@travetto/di';

class Config {
  @InjectableFactory()
  static getTransport() {
    return new NodemailerTransport(require('nodemailer-smtp-transport'));
  }
}

Code: ses to send all messages via the ses operation

import { NodemailerTransport } from '@travetto/email';
import { InjectableFactory } from '@travetto/di';

class Config {
  @InjectableFactory()
  static getTransport() {
    return new NodemailerTransport(require('nodemailer-ses-transport'));
  }
}

Current Tags

  • 1.0.0-beta.3                                ...           beta (a year ago)
  • 1.0.5                                ...           latest (23 days ago)
  • 1.0.0-rc.2                                ...           next (2 months ago)
  • 1.0.0-rc.3                                ...           rc (2 months ago)

139 Versions

  • 1.0.5                                ...           23 days ago
  • 1.0.4                                ...           24 days ago
  • 1.0.3                                ...           a month ago
  • 1.0.2                                ...           a month ago
  • 1.0.1                                ...           a month ago
  • 1.0.0                                ...           a month ago
  • 1.0.0-rc.13                                ...           2 months ago
  • 1.0.0-rc.12                                ...           2 months ago
  • 1.0.0-rc.11                                ...           2 months ago
  • 1.0.0-rc.10                                ...           2 months ago
  • 1.0.0-rc.9                                ...           2 months ago
  • 1.0.0-rc.8                                ...           2 months ago
  • 1.0.0-rc.7                                ...           2 months ago
  • 1.0.0-rc.6                                ...           2 months ago
  • 1.0.0-rc.5                                ...           2 months ago
  • 1.0.0-rc.4                                ...           2 months ago
  • 1.0.0-rc.3                                ...           2 months ago
  • 1.0.0-rc.2                                ...           2 months ago
  • 1.0.0-rc.1                                ...           3 months ago
  • 1.0.0-rc.0                                ...           3 months ago
  • 1.0.0-beta.3                                ...           a year ago
  • 1.0.0-beta.2                                ...           a year ago
  • 1.0.0-beta.1                                ...           a year ago
  • 0.7.4                                ...           a year ago
  • 0.7.3                                ...           a year ago
  • 0.7.2                                ...           a year ago
  • 0.7.1                                ...           a year ago
  • 0.7.1-alpha.6                                ...           a year ago
  • 0.7.1-alpha.5                                ...           a year ago
  • 0.7.1-alpha.4                                ...           a year ago
  • 0.7.1-alpha.3                                ...           a year ago
  • 0.7.1-alpha.2                                ...           a year ago
  • 0.7.1-alpha.1                                ...           a year ago
  • 0.7.1-alpha.0                                ...           a year ago
  • 0.7.0-alpha.0                                ...           a year ago
  • 0.6.9                                ...           a year ago
  • 0.6.8                                ...           a year ago
  • 0.6.7                                ...           a year ago
  • 0.6.6                                ...           a year ago
  • 0.6.5                                ...           a year ago
  • 0.6.4                                ...           a year ago
  • 0.6.3                                ...           a year ago
  • 0.6.1                                ...           a year ago
  • 0.6.0                                ...           a year ago
  • 0.6.0-rc.10                                ...           a year ago
  • 0.6.0-rc.9                                ...           a year ago
  • 0.6.0-rc.8                                ...           a year ago
  • 0.6.0-rc.7                                ...           a year ago
  • 0.6.0-rc.6                                ...           a year ago
  • 0.6.0-rc.4                                ...           a year ago
  • 0.6.0-rc.3                                ...           a year ago
  • 0.6.0-rc.2                                ...           a year ago
  • 0.6.0-rc.1                                ...           a year ago
  • 0.6.0-rc.0                                ...           a year ago
  • 0.5.12                                ...           2 years ago
  • 0.5.11                                ...           2 years ago
  • 0.5.10                                ...           2 years ago
  • 0.5.9                                ...           2 years ago
  • 0.5.8                                ...           2 years ago
  • 0.5.7                                ...           2 years ago
  • 0.5.6                                ...           2 years ago
  • 0.5.5                                ...           2 years ago
  • 0.5.4                                ...           2 years ago
  • 0.5.3                                ...           2 years ago
  • 0.5.2                                ...           2 years ago
  • 0.5.1                                ...           2 years ago
  • 0.5.0                                ...           2 years ago
  • 0.4.10                                ...           2 years ago
  • 0.4.9                                ...           2 years ago
  • 0.4.8                                ...           2 years ago
  • 0.4.7                                ...           2 years ago
  • 0.4.6                                ...           2 years ago
  • 0.4.5                                ...           2 years ago
  • 0.4.4                                ...           2 years ago
  • 0.4.3                                ...           2 years ago
  • 0.4.2                                ...           2 years ago
  • 0.4.1                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.20                                ...           2 years ago
  • 0.3.19                                ...           2 years ago
  • 0.3.18                                ...           2 years ago
  • 0.3.17                                ...           2 years ago
  • 0.3.16                                ...           2 years ago
  • 0.3.15                                ...           2 years ago
  • 0.3.14                                ...           2 years ago
  • 0.3.13                                ...           2 years ago
  • 0.3.12                                ...           2 years ago
  • 0.3.11                                ...           2 years ago
  • 0.3.10                                ...           2 years ago
  • 0.3.9                                ...           2 years ago
  • 0.3.8                                ...           2 years ago
  • 0.3.7                                ...           2 years ago
  • 0.3.6                                ...           2 years ago
  • 0.3.5                                ...           2 years ago
  • 0.3.4                                ...           2 years ago
  • 0.3.3                                ...           2 years ago
  • 0.3.2                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.2.14                                ...           2 years ago
  • 0.2.13                                ...           2 years ago
  • 0.2.12                                ...           2 years ago
  • 0.2.11                                ...           2 years ago
  • 0.2.10                                ...           2 years ago
  • 0.2.9                                ...           2 years ago
  • 0.2.8                                ...           2 years ago
  • 0.2.7                                ...           2 years ago
  • 0.2.5                                ...           2 years ago
  • 0.2.4                                ...           2 years ago
  • 0.2.2                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.6                                ...           2 years ago
  • 0.1.5                                ...           2 years ago
  • 0.1.4                                ...           2 years ago
  • 0.1.3                                ...           2 years ago
  • 0.1.2                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
  • 0.0.23                                ...           2 years ago
  • 0.0.22                                ...           2 years ago
  • 0.0.21                                ...           2 years ago
  • 0.0.20                                ...           2 years ago
  • 0.0.19                                ...           2 years ago
  • 0.0.18                                ...           2 years ago
  • 0.0.17                                ...           2 years ago
  • 0.0.16                                ...           2 years ago
  • 0.0.15                                ...           2 years ago
  • 0.0.14                                ...           2 years ago
  • 0.0.13                                ...           2 years ago
  • 0.0.12                                ...           2 years ago
  • 0.0.11                                ...           2 years ago
  • 0.0.10                                ...           2 years ago
  • 0.0.9                                ...           2 years ago
  • 0.0.8                                ...           2 years ago
  • 0.0.7                                ...           2 years ago
  • 0.0.6                                ...           2 years ago
  • 0.0.5                                ...           3 years ago
  • 0.0.4                                ...           3 years ago
  • 0.0.3                                ...           3 years ago
  • 0.0.2                                ...           3 years ago
  • 0.0.1                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 114
Dependencies (4)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |