Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iwatakeshi/mailman.js
A small Javascript library that allows you to send emails using Mandrill's email service.
https://github.com/iwatakeshi/mailman.js
Last synced: 6 days ago
JSON representation
A small Javascript library that allows you to send emails using Mandrill's email service.
- Host: GitHub
- URL: https://github.com/iwatakeshi/mailman.js
- Owner: iwatakeshi
- License: mit
- Created: 2014-07-20T00:12:26.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-11-03T16:04:25.000Z (about 6 years ago)
- Last Synced: 2024-03-18T01:11:04.611Z (10 months ago)
- Language: JavaScript
- Size: 91.8 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
mailman.js
==========A small Javascript library that sends emails using [Mandrill](http://www.mandrillapp.com)'s email service.
##Usage
###In the browser
```html```
###In Node.js
```npm
npm install mailman.js
```
``` javascript
var mailman = require('mailman.js');
/*note: if that gives you errors try:
var mailman = require('.bin/mailman.js');
*/
```
##Example: Ping Pong
```javascript
//create a request
var request = {
//mailman uses dot notation to access the url of your desired api call
api:"users.ping",
//the data to be sent
data:{
key:"your mandrill key here"
},
//enable debug to see tech savvy stuff in the console
debug:true
}
//pass in the request to mailman and make the request
mailman(request).request();
//since request() supports "deferred"
//you can get the response like so:
mailman(request).request().done(function(response){
//do something with response
});
```##Example: Send Emails
```javascript
//create a request
var request = {
//set the api
api: "messages.send",
data: {
message:{
html:"Example HTML content
",
text:"Example text content",
subject:"example subject",
from_email: "[email protected]",
from_name: "Example Name",
//note that this is an array, therefore you can send
//to multiple recipients
to:[{
email: "[email protected]",
name:"Example",
type: "to"
}]
}
}//pass the request and make the request
mailman(request).request();
```##Making Requests
Visit the Mandrill's [documentation](https://mandrillapp.com/api/docs/index.JSON.html).
They have examples with the proper JSON format. Requests shown in the examples are following
the format.##Available API Call Category
* Users
* Messages
* Tags
* Rejects
* Whitelists
* Senders
* Urls
* Templates
* Webhooks
* Subaccounts
* Inbound
* Exports
* Ips
* Metadata##Tested API
* Users
* Messages
* send