nodemailer-mandrill-transport

WebJar for nodemailer-mandrill-transport

License

License

ISC
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

nodemailer-mandrill-transport
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

nodemailer-mandrill-transport
WebJar for nodemailer-mandrill-transport
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/RebelMail/nodemailer-mandrill-transport

Download nodemailer-mandrill-transport

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/nodemailer-mandrill-transport/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>nodemailer-mandrill-transport</artifactId>
    <version>1.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/nodemailer-mandrill-transport/
implementation 'org.webjars.npm:nodemailer-mandrill-transport:1.2.0'
// https://jarcasting.com/artifacts/org.webjars.npm/nodemailer-mandrill-transport/
implementation ("org.webjars.npm:nodemailer-mandrill-transport:1.2.0")
'org.webjars.npm:nodemailer-mandrill-transport:jar:1.2.0'
<dependency org="org.webjars.npm" name="nodemailer-mandrill-transport" rev="1.2.0">
  <artifact name="nodemailer-mandrill-transport" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='nodemailer-mandrill-transport', version='1.2.0')
)
libraryDependencies += "org.webjars.npm" % "nodemailer-mandrill-transport" % "1.2.0"
[org.webjars.npm/nodemailer-mandrill-transport "1.2.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : addressparser jar [1.0.1,2)
org.webjars.npm : extend jar [3.0.0,4)
org.webjars.npm » mandrill-api jar [1.0.45,2)

Project Modules

There are no modules declared in this project.

nodemailer-mandrill-transport

A Mandrill transport for Nodemailer.

Build Status Coverage Status npm version Dependency Status devDependency Status

Example

'use strict';

var nodemailer = require('nodemailer');

var mandrillTransport = require('nodemailer-mandrill-transport');

var transport = nodemailer.createTransport(mandrillTransport({
  auth: {
    apiKey: 'key'
  }
}));

transport.sendMail({
  from: '[email protected]',
  to: '[email protected]',
  subject: 'Hello',
  html: '<p>How are you?</p>'
}, function(err, info) {
  if (err) {
    console.error(err);
  } else {
    console.log(info);
  }
});

Using Mandrill API options

It is possible to use any Messages Send Mandrill API option by passing it into the mandrillOptions option. These will be deeply merged over the API call this transport builds for you. For example, this transport enables the async option by default. To disable this,

transport.sendMail({
  mandrillOptions: {
    async: false
  }
}, /* ... */);

Sending Images to Mandrill

To send images as attachments:

transport.sendMail({
  mandrillOptions: {
    images: [
      'type': 'image/png',
      'name': 'IMAGECID',
      'content': 'ZXhhbXBsZSBmaWxl',
    ],
  }
}, /* ... */);

name: image cid:

Reference your attached image in your HTML:

<img src="IMAGECID">

Make sure to use unique cids for your images!

content: a base64 representation of your image.

var fs = require('fs');
var imgBuff = fs.readFileSync('path/to/file');

imgBuff.toString('base64');

Using Mandrill Templates

To send email using templates stored on Mandrill:

transport.sendMail({
  mandrillOptions: {
    template_name: 'MANDRILL_TEMPLATE_SLUG'
  }
}, /* ... */);
org.webjars.npm

Rebel

Bringing native interactivity to email, no plugins necessary.

Versions

Version
1.2.0