Skip to content

Instantly share code, notes, and snippets.

@sendgrid-gists
Last active May 11, 2016 17:45
Show Gist options
  • Save sendgrid-gists/42957ac067888494b19f853541c0180b to your computer and use it in GitHub Desktop.
Save sendgrid-gists/42957ac067888494b19f853541c0180b to your computer and use it in GitHub Desktop.
"Hello World" for email, using SendGrid with Ruby.
# 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