Skip to content

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

Description

@grassland-curing-cfa

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);

Activity

  1. flovilmart commented on Mar 1, 2016

    @flovilmart
    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});
    
  2. grassland-curing-cfa commented on Mar 1, 2016

    @grassland-curing-cfa
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions