# mandrill-redirect

> Redirect emails declared in Mandrill template data to a single developer's/QA's email. Useful during development and testing. E.g. Given two recipients jack@gmail.com, jill@gmail.com and a redirect email of test@gmail.com the resulting recipients will be test+0@gmail.com and test+1@gmail.com.

Latest version **1.0.0** (published 2013-06-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install mandrill-redirect
pnpm add mandrill-redirect
yarn add mandrill-redirect
bun add mandrill-redirect
```

## 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.0.0 |
| Published | 2013-06-24 |
| First published | 2013-06-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Rick Cotter |
| Maintainers | beaucoo |
| Keywords | mandrill, test, redirect, email, template, send |

## Links

- npm: https://www.npmjs.com/package/mandrill-redirect
- Repository: https://github.com/beaucoo/mandrill-redirect
- Issues: https://github.com/beaucoo/mandrill-redirect/issues
- npm.io page: https://npm.io/package/mandrill-redirect

## 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.0.0 (latest) — 2013-06-24

## README

mandrill-redirect
=================

Redirect emails declared in [Mandrill template](https://mandrillapp.com/api/docs/messages.JSON.html#method=send-template) data to a single developer's/QA's email. Useful during development and testing.

E.g. Given two recipients jack@gmail.com, jill@gmail.com and a redirect email of test@gmail.com
the resulting recipients will be test+0@gmail.com and test+1@gmail.com.


##Use

Install via <code>npm install mandrill-redirect</code>

and use:

<pre>
<code>
    var redirect = require('mandrill-redirect');
    redirect(template, "test@gmail.com"); // Returns true/false
</code>
</pre>

rewrites a Mandrill template:

<pre>
<code>
    {
        message:{
            to: ["jack@gmail.com", "jill@gmail.com"],
            merge_vars: [
                {
                    rcpt: "jack@gmail.com",
                    vars: [...]
                },
                {
                    rcpt: "jill@gmail.com",
                    vars: [...]
                }
            ],
            recipient_metadata:[
                {
                    "rcpt": "jack@gmail.com",
                    "values": [...]
                },
                {
                    "rcpt": "jill@gmail.com",
                    "values": [...]
                }
            ]
        }
    }
</code>
</pre>


to:

<pre>
<code>
    {
        message: {
            to: ["redirect+0@gmail.com", "redirect+1@gmail.com"],
            merge_vars: [
                {
                    rcpt: "redirect+0@gmail.com",
                    vars: [...]
                },
                {
                    rcpt: "redirect+1@gmail.com",
                    vars: [...]
                }
            ],
            recipient_metadata:[
                {
                    "rcpt": "redirect+0@gmail.com",
                    "values": [...]
                },
                {
                    "rcpt": "redirect+1@gmail.com",
                    "values": [...]
                }
            ]
        }
    }
</code>
</pre>


Also:

* **to** is mandatory and must have length
* **merge_vars** is optional but if provided must match the length of **to**
* **recipient_metadata** is optional but if provided must match the length of **to**
* If no email is given for redirecting then any template manipulation is skipped.
* The return value is true/false indicating success/failure. The template is rewritten in place.

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