Skip to content

Instantly share code, notes, and snippets.

@fortyfivan
Created March 28, 2016 03:11
Show Gist options
  • Save fortyfivan/9b62a9ddedca891d8c03 to your computer and use it in GitHub Desktop.
Save fortyfivan/9b62a9ddedca891d8c03 to your computer and use it in GitHub Desktop.
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