Skip to content

thibremy/nodemailer-mandrill-template-transport

Repository files navigation

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 [email protected]',
  to: '[email protected], [email protected]',
  cc: '[email protected], [email protected]',
  bcc: [
    '[email protected]', {
      name: 'Майлер, Ноде',
      address: '[email protected]'
    }
  ],
  replyTo: '[email protected]',
  messageId: 'test',
});

// transform to mandrill options

{
  template_name: 'contact-form',
  template_content:[],
  message: {
    headers: {
      'Reply-To': '[email protected]'
    },
    subject: 'Hello',
    messageId: 'test',
    from_email: '[email protected]',
    from_name: 'bernie senders',
    to: [{
      email: '[email protected]',
      name: '',
      type: 'to'
    }, {
      email: '[email protected]',
      name: '',
      type: 'to'
    }, {
      email: '[email protected]',
      name: '',
      type: 'cc'
    }, {
      email: '[email protected]',
      name: '',
      type: 'cc'
    }, {
      email: '[email protected]',
      name: '',
      type: 'bcc'
    }, {
      email: '[email protected]',
      name: 'Майлер, Ноде',
      type: 'bcc'
    }]
  }
}

About

Mandrill transport for Nodemailer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published