Created
March 28, 2016 03:11
-
-
Save fortyfivan/9b62a9ddedca891d8c03 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
require_relative 'bundle/bundler/setup' | |
require 'iron_worker' | |
require 'sendgrid-ruby' | |
client = SendGrid::Client.new(api_key: 'SENDGRID_APIKEY') | |
mail = SendGrid::Mail.new do |m| | |
m.to = IronWorker.payload["to"] | |
m.from = IronWorker.payload["from"] | |
m.subject = IronWorker.payload["subject"] | |
m.text = IronWorker.payload["text"] | |
end | |
res = client.send(mail) | |
puts res.code | |
puts res.body |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment