@transomjs/transom-smtp

3.0.0 • Public • Published

transom-smtp

Add simple to use SMTP messaging functions to your server-side Transomjs code.

Build Status Coverage Status

Installation

$ npm install --save @transomjs/transom-smtp

Usage

options.smtp

options.smtp is passed in directly to nodemailer.createTransport() and follows the nodemailer configuration.

options.helpers

options.helpers adds methods to send email from specific addresses. The following example puts "sendFromNoreply()" and "sendFromAdmin()" methods on the transomSmtp Object.

NOTE: a sendFromNoreply() method is required when using transomSmtp with the transom-mongoose-localuser.

    const Transom = require('@transomjs/transom-core');
    const transomSmtp = require('@transomjs/transom-smtp');

    const transom = new Transom();

    const options = {
        smtp: {
            host: 'smtp.example.com',
            port: 587,
            secure: false,
            auth: {
                user: 'username',
                pass: 'password'
            }
        },
        helpers: {
            noreply: '"No Replies" donotreply@hello.com',
            admin: 'administrator@hello.com'
		}
    };
    transom.configure(transomSmtp, options);

    transom.initialize(server, myApi).then(function(server){
    	...
    });

Readme

Keywords

Package Sidebar

Install

npm i @transomjs/transom-smtp

Weekly Downloads

2

Version

3.0.0

License

MIT

Unpacked Size

5.88 kB

Total Files

6

Last publish

Collaborators

  • binaryops.mark
  • binaryops.wiebo