Introducing the SendGrid Cloud Module

A few weeks ago, we unveiled Cloud Modules, a new way to integrate your Parse app with┬áthird-party services. With that release we promised several more modules would be on their way. Today, we’re happy to announce the first of these new modules, SendGrid. SendGrid provides an easy to use email service that allows you to send and receive emails using their API. Here’s a look at how the Cloud Module works:

var sendgrid = require("sendgrid");
sendgrid.initialize("sendgridAccountSid", "sendgridAuthToken");

Parse.Cloud.define("mySendGridFunction", function(request, response) {
  sendgrid.sendEmail({
    to: "community@parse.com",
    from: "sendgrid@parse.com",
    subject: "Hello from Cloud Code!",
    text: "Using Parse and SendGrid is great!"
  }, {
    success: function(httpResponse) { response.success("Email sent!"); },
    error: function(httpResponse) { response.error("Uh oh, something went wrong"); }
  });
});

To learn more about this new module check out our Cloud Modules guide. We’ll be releasing many more, so let us know what you’d like to see next using the form below.

Mattieu Gamache-Asselin
November 19, 2012
blog comments powered by Disqus

Comments are closed.

Archives

Categories

RSS Feed Follow us Like us