Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which mailgun library should be used for migration to Heroku? #730

Closed
grassland-curing-cfa opened this issue Mar 1, 2016 · 2 comments
Closed

Comments

@grassland-curing-cfa
Copy link

I need to migrate the current Parse hosted Cloud code to my Heroku application.

It seems there are a few mailgun libraries for Node.JS, e.g. mailgun and mailgun-js. I am just wondering which is the one the current api.parse.com uses. I will need to migrate my Cloud code and use that library.

An example of the dependencies in package.js and a working example of how to use the library to send a HelloWorld email would be really helpful.

My current Cloud code hosted on api.parse.com looks like:

var Mailgun = require('mailgun');
Mailgun.initialize(MG_DOMAIN, MG_KEY);
@flovilmart
Copy link
Contributor

You can use any mailgun library out there:

with mailgun:

var Mailgun = require("mailgun");
var mg = new Mailgun('api-key');

with mailgun-js

var api_key = 'key-XXXXXXXXXXXXXXXXXXXXXXX';
var domain = 'mydomain.mailgun.org';
var mailgun = require('mailgun-js')({apiKey: api_key, domain: domain});

@grassland-curing-cfa
Copy link
Author

Are you able to help offer some working examples of using both of those libs to send emails and handle callback functions to deal with error or sent messages?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants