Skip to content

Instantly share code, notes, and snippets.

@theycallmeswift
Created June 4, 2012 01:36
Show Gist options
  • Save theycallmeswift/2865806 to your computer and use it in GitHub Desktop.
Save theycallmeswift/2865806 to your computer and use it in GitHub Desktop.
Hack the Midwest Livecode Demo
var express = require('express')
, app = express.createServer()
, SendGrid = require('sendgrid').SendGrid
, sendgrid = new SendGrid("hackthemidwest", "hackthemidwest");
app.get('/swiftIsAwesome', function(req, res) {
sendgrid.send({
to: "[email protected]",
from: "[email protected]",
subject: "SendGrid is easy to use and awesome",
text: "Trust me, if this email goes through (which it will), then I'm right"
}, function(success, response) {
if(!success) {
res.send("OOPS. Swift messed up, and here's why: " + response);
} else {
res.send("Email Sent");
}
});
});
app.listen(3000);
app.on("listening", function() {
console.log("I AM LISTENING");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment