Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dandv/mandrill
DEPRECATED: just use the Mandrill NPM package, or better yet, switch to SparkPost
https://github.com/dandv/mandrill
mandrill-api-wrapper meteor
Last synced: 25 days ago
JSON representation
DEPRECATED: just use the Mandrill NPM package, or better yet, switch to SparkPost
- Host: GitHub
- URL: https://github.com/dandv/mandrill
- Owner: dandv
- License: mit
- Created: 2015-07-16T08:01:52.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-02T08:42:02.000Z (over 9 years ago)
- Last Synced: 2024-10-15T03:46:13.219Z (2 months ago)
- Topics: mandrill-api-wrapper, meteor
- Language: CoffeeScript
- Homepage:
- Size: 128 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mjmasn:mandrill
This Meteor package wraps the ```mandrill-api``` NPM package. As it is a fairly simple wrap of the NPM package, I have only tested the messages.send function but all functions should all work as expected. If you do discover any issues please open a new issue or submit a PR.
## Installation
This package is available at https://atmospherejs.com/mjmasn/mandrill. To install use:```meteor add mjmasn:mandrill```
## Environment Variables
This package requires ```MANDRILL_API_KEY``` to be set in your environment variables and will throw an error if it is not set. You can obtain an API key by logging in at https://mandrillapp.com/settings/index and clicking 'New API Key'.## Usage
Usage for this package is slightly different to the NPM package. In plain Node you would do:
```javascript
Mandrill.messages.send(options, function (result) {
// Success function
}, function (err) {
// Error function
});
```
In Meteor you do:
```javascript
try {
var result = Mandrill.messages('send', options);
}
catch (err) {
// Handle any errors
}
```So the basic format is ```Mandrill.CATEGORY(METHOD, options)``` where CATEGORY is one of:
```users``` ```messages``` ```tags``` ```rejects``` ```whitelists``` ```senders``` ```urls``` ```templates``` ```webhooks``` ```subaccounts``` ```inbound``` ```exports``` ```ips``` ```metadata```
and METHOD is the method you want to call, for example ```'sendTemplate'```. See the [Mandrill API Documentation](https://mandrillapp.com/api/docs/index.nodejs.html) for the available methods and options.