Created
April 16, 2013 17:00
-
-
Save theycallmeswift/5397596 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var arduino = require("johnny-five") | |
, board = new arduino.Board() | |
, SendGrid = require('sendgrid').SendGrid | |
, sg = new SendGrid("your_sendgrid_username", "your_sendgrid_password"); | |
board.on("ready", function() { | |
var button = new arduino.Button(8); // Button on pin 8 | |
button.on("up", function() { | |
sg.send({ | |
to: "john.doe@example.com" | |
from: "jane.doe@example.com", | |
subject: "This email will be sent when you press the button", | |
html: "Go check your inbox!" | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment