# nodemailer-mandrill-transport

> Mandrill transport for Nodemailer

Latest version **1.2.0** (published 2016-08-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install nodemailer-mandrill-transport
pnpm add nodemailer-mandrill-transport
yarn add nodemailer-mandrill-transport
bun add nodemailer-mandrill-transport
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2016-08-12 |
| First published | 2015-03-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 57 |
| Author | Rebelmail |
| Maintainers | devinus, motdotla, elbuo8 |
| Keywords | nodemailer, mandrill |

## Links

- npm: https://www.npmjs.com/package/nodemailer-mandrill-transport
- Repository: https://github.com/RebelMail/nodemailer-mandrill-transport
- Homepage: https://github.com/Rebelmail/nodemailer-mandrill-transport
- Issues: https://github.com/Rebelmail/nodemailer-mandrill-transport/issues
- npm.io page: https://npm.io/package/nodemailer-mandrill-transport

## Dependencies (3)

- [extend](https://npm.io/package/extend.md) ^3.0.0
- [mandrill-api](https://npm.io/package/mandrill-api.md) ^1.0.45
- [addressparser](https://npm.io/package/addressparser.md) ^1.0.1

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2016-08-12
- 1.1.0 — 2016-02-19
- 1.0.0 — 2015-11-25
- 0.3.0 — 2015-06-10
- 0.2.0 — 2015-05-22
- 0.1.1 — 2015-04-15
- 0.1.0 — 2015-03-30

## README

# nodemailer-mandrill-transport

A Mandrill transport for Nodemailer.

[![Build Status](https://travis-ci.org/Rebelmail/nodemailer-mandrill-transport.svg?branch=sm-readme)](https://travis-ci.org/Rebelmail/nodemailer-mandrill-transport)
[![NPM version](https://badge.fury.io/js/nodemailer-mandrill-transport.png)](http://badge.fury.io/js/nodemailer-mandrill-transport)

## Example

```javascript
'use strict';

var nodemailer = require('nodemailer');

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

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

transport.sendMail({
  from: 'sender@example.com',
  to: 'user@example.com',
  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,

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

## Sending Images to Mandrill

To send images as attachments:

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

**name**: image cid:

Reference your attached image in your HTML:

```html
<img src="IMAGECID">
```

Make sure to use unique cids for your images!

**content**: a base64 representation of your image.

```javascript
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:

```javascript
transport.sendMail({
  mandrillOptions: {
    template_name: 'MANDRILL_TEMPLATE_SLUG'
  }
}, /* ... */);
```

---
_Source: https://npm.io/package/nodemailer-mandrill-transport · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
