nodemailer-mandrill-template-transport
Mandrill transport for Nodemailer
Last updated 5 years ago by thibremy .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install nodemailer-mandrill-template-transport 
SYNC missed versions from official npm registry.

nodemailer-mandrill-template-transport

A Mandrill transport for Nodemailer, it's a mix beetween nodemailer-mandrill-transport and commons E-mail message fields.

This package use "Mandrill.message#send-template".

Example

import nodemailer from 'nodemailer';
import mandrillTemplateTransport from 'nodemailer-mandrill-template-transport';

const transport = nodemailer.createTransport(mandrillTemplateTransport({
  auth: {
    apiKey: 'key'
  }
}));



transport.sendMail({
  template_name: 'contact-form',
  template_content: [],
  subject: 'Hello',
  from: 'bernie senders sender@example.com',
  to: 'user@example.com, user2@example.com',
  cc: 'cc@example.com, cc@example.com',
  bcc: [
    'foobar@blurdybloop.com', {
      name: 'Майлер, Ноде',
      address: 'foobar@blurdybloop.com'
    }
  ],
  replyTo: 'test@tet.com',
  messageId: 'test',
});

// transform to mandrill options

{
  template_name: 'contact-form',
  template_content:[],
  message: {
    headers: {
      'Reply-To': 'test@tet.com'
    },
    subject: 'Hello',
    messageId: 'test',
    from_email: 'sender@example.com',
    from_name: 'bernie senders',
    to: [{
      email: 'user@example.com',
      name: '',
      type: 'to'
    }, {
      email: 'user2@example.com',
      name: '',
      type: 'to'
    }, {
      email: 'cc@example.com',
      name: '',
      type: 'cc'
    }, {
      email: 'cc@example.com',
      name: '',
      type: 'cc'
    }, {
      email: 'foobar@blurdybloop.com',
      name: '',
      type: 'bcc'
    }, {
      email: 'foobar@blurdybloop.com',
      name: 'Майлер, Ноде',
      type: 'bcc'
    }]
  }
}


Current Tags

  • 1.0.4                                ...           latest (5 years ago)

5 Versions

  • 1.0.4                                ...           5 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (14)
Dev Dependencies (12)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |