Last active
May 11, 2016 17:45
-
-
Save sendgrid-gists/42957ac067888494b19f853541c0180b to your computer and use it in GitHub Desktop.
"Hello World" for email, using SendGrid with Ruby.
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
# using SendGrid's Ruby Library | |
# https://github.com/sendgrid/sendgrid-ruby | |
require 'sendgrid-ruby' | |
sendgrid = SendGrid::Client.new do |c| | |
c.api_key = 'SENDGRID_APIKEY' | |
end | |
email = SendGrid::Mail.new do |m| | |
m.to = 'test@sendgrid.com' | |
m.from = 'you@youremail.com' | |
m.subject = 'Sending with SendGrid is Fun' | |
m.html = 'and easy to do anywhere, even with Ruby' | |
end | |
sendgrid.send(email) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment