Skip to content

Instantly share code, notes, and snippets.

@theycallmeswift
Created April 16, 2013 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theycallmeswift/5397596 to your computer and use it in GitHub Desktop.
Save theycallmeswift/5397596 to your computer and use it in GitHub Desktop.
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