<commit_before>meteor-mandrill
===============

Mandrill REST API `mandrill-api` NPM package for Meteor.

## Installation
```bach
    meteor add risul:mandrill
```

## Required settings
Add this to your settings.json or METEOR_SETTINGS env variable

```json
{
    "mandrill": {
        "key": "YOUR_MANDRILL_API_KEY"
    }
}
```

## Enable SMTP
If you want to automacitally set the environment variable for SMTP server so that Meteor's [Email package](http://docs.meteor.com/#/full/email) works out of the box, you will need to add "SMTP" section in settings: 

```json
{
    "mandrill": {
        "key": "YOUR_MANDRILL_API_KEY",
        
        "SMTP": {
            "user": "YOUR_MANDRILL_USERNAME",
            "host": "smtp.mandrillapp.com",
            "port": "2525"
        }
    }
}
```

SMTP host: `mandrill.SMTP.host` and SMTP port: `mandrill.SMTP.port` are optional.


## Additional settings
You can also add a `defaults` section with default sender name and e-mail

```json
{
    "mandrill": {
        "key": "YOUR_MANDRILL_API_KEY",
        
        "SMTP": {
            "user": "YOUR_MANDRILL_USERNAME",
            "host": "smtp.mandrillapp.com",
            "port": "2525"
        },
        
        "defaults": {
            "from_name": "YOUR_APP_NAME",
            "from_email": "DEFAULT_E-MAIL_ADDRESS"
        }
    }
}
```

.. and then get all needed message parameters before you send an e-mail using the API.

```js
    var mailparams = Mandrill.getMessageParams("Email subject", "Email body", "<EMAIL>");
```

You can also change from name, from email and reply to email address:

```js
    var mailparams = Mandrill.getMessageParams(subject, msg, mailTo, fromName, fromEmail, replyTo);
```

This will return a complete Mandrill message parameter object which you can use to send the email:

```js
    try {
        var result = Mandrill.messages('send', mailparams);
        console.log("Email sent", result);
    }
    catch (err) {
        console.log("Could not send email", err);
    }
```

List of API's supported by the library.
=======================================
Refer [here](https://mandrillapp.com/api/docs/index.nodejs.html) for complete documentation of Mandrill NodeJS API documentation.<commit_msg>Deprecate package in favor of the full HTTP API package<commit_after># Deprecated

This package was a thin wrapper around the Node.js mandrill-api package, which in turn does [nothing more than use Mandrill's HTTP API](https://bitbucket.org/mailchimp/mandrill-api-node/src/). As such, you're better off using the wylio:mandrill package, which is a full implementation of Mandrill's direct HTTP API, along with tests and a guide to how to use Meteor's default `Accounts.emailTemplates` with Mandrill.
{'fraction_non_alphanumeric': 0.13119533527696792, 'fraction_numerical': 0.0029154518950437317, 'mean_word_length': 3.1717325227963524, 'pattern_counts': {'":': 17, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3536282', 'n_tokens_mistral': 891, 'n_tokens_neox': 830, 'n_words': 274}