npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-cli-mandrill

v0.2.0

Published

Mandrill API for Ember.js web apps.

Downloads

8

Readme

ember-cli-mandrill

This addon is the drop-in-and-use client implementation of Mandrill API for Ember.js. It integrates the service into your Ember.js web app which is proxying to the Mandrill and allows you to query for data with native-like API objects.

Installation

ember install ember-cli-mandrill

Initial Configuration

After installation, you need to configurate Mandrill client to do connection and access the API.

In your config/environment.js file add and edit:

ENV['mandrill'] = {
  api: {
    host: 'https://mandrillapp.com/api/1.0/',
    key: 'YOUR_API_KEY_HERE'
  },

  smtp: {
    host: 'smtp.mandrillapp.com',
    port: 587,
    username: 'YOUR_USERNAME',
    password: 'YOUR_PASSWORD'
  }

};

Addon API and How-to-Use

Currently, only Users Calls API and Messages Calls API are fully implemented. All methods return a Promise, so you can do this:

this.mandrill.send(newEmail).then(function(response) {
  alert('Email sent!' + response);
});

The list of available actions:

PAY ATTENTION: You don't need to pass your API key to any of the methods!

What objects to pass to corresponding methods and how do they look, you should directly look up on Messages Calls API.

Users Calls API methods

These are the addon methods that are proxying to Users Calls Mandrill API.

getUserInfo()

Returns you information about the current API user. Accepts no parameters. Proxying to Users#info Mandrill API method.

this.mandrill.getUserInfo().then(function(response) {
//do whatever you want with 'response' object
});

userPing()

Validates an API key and respond to a ping. Accepts no parameters. Proxying to Users#ping Mandrill API method.

this.mandrill.userPing().then(function(response) {
//do whatever you want with 'response' object
});

userPing2()

Validates an API key and respond to a ping (analogous JSON parser version). Accepts no parameters. Proxying to Users#ping2 Mandrill API method.

this.mandrill.userPing2().then(function(response) {
//do whatever you want with 'response' object
});

userSenders()

Returns the senders that have tried to use this account, both verified and unverified. Accepts no parameters. Proxying to Users#senders Mandrill API method.

this.mandrill.userSenders().then(function(response) {
//do whatever you want with 'response' object
});

Messages Calls API methods

These are the addon methods that are proxying to Messages Calls Mandrill API.

send()

Sends a new transactional email. Accepts email object as a parameter. Proxying to Messages#send Mandrill API method.

this.mandrill.send(newEmail).then(function(response) {
//do whatever you want with 'response' object
});

sendTemplate()

Sends a new transactional email using a template. Accepts email object as a parameter. Proxying to Message#send-template Mandrill API method.

this.mandrill.sendTemplate(newEmail).then(function(response) {
//do whatever you want with 'response' object
});

search()

Searches recently sent messages and optionally narrow by date range, tags, senders, and API keys. Accepts query object as a parameter. Proxying to Messages#search Mandrill API method.

this.mandrill.search(query).then(function(response) {
//do whatever you want with 'response' object
});

getEmailInfo()

Gets the information for a single recently sent message. Accepts email id as a parameter. Proxying to Messages#info Mandrill API method.

this.mandrill.getEmailInfo(5).then(function(response) {
//do whatever you want with 'response' object
});

getEmailContent()

Gets the full content of a recently sent message. Accepts email id as a parameter. Proxying to Messages#content Mandrill API method.

this.mandrill.getEmailContent(7).then(function(response) {
//do whatever you want with 'response' object
});

parseEmail()

Parses the full MIME document for an email message, returning the content of the message broken into its constituent pieces. Accepts raw email object as a parameter. Proxying to Messages#parse Mandrill API method.

this.mandrill.parseEmail(raw).then(function(response) {
//do whatever you want with 'response' object
});

sendRawEmail()

Takes a raw MIME document for a message, and send it exactly as if it were sent through Mandrill's SMTP servers. Accepts email object as a parameter. Proxying to Messages#send-raw Mandrill API method.

this.mandrill.sendRawEmail(email).then(function(response) {
//do whatever you want with 'response' object
});

listScheduled()

Queries your scheduled emails. Accepts recipient string as a parameter. Proxying to Messages#list-scheduled Mandrill API method.

this.mandrill.listScheduled(recipient).then(function(response) {
//do whatever you want with 'response' object
});

cancelScheduled()

Cancels a scheduled email. Accepts email id as a parameter. Proxying to Messages#cancel-scheduled Mandrill API method.

this.mandrill.cancelScheduled(9).then(function(response) {
//do whatever you want with 'response' object
});

reschedule()

Reschedules a scheduled email. Accepts query object as a parameter. Proxying to Messages#reschedule.

this.mandrill.cancelScheduled(query).then(function(response) {
//do whatever you want with 'response' object
});

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.