We recommend using SendGrid Ruby, our client library, available on GitHub, with full documentation.
Do you have an API Key yet? If not, go get one. You're going to need it to integrate!
_16# using SendGrid's Ruby Library_16# https://github.com/sendgrid/sendgrid-ruby_16require 'sendgrid-ruby'_16include SendGrid_16_16from = SendGrid::Email.new(email: 'test@example.com')_16to = SendGrid::Email.new(email: 'test@example.com')_16subject = 'Sending with SendGrid is Fun'_16content = SendGrid::Content.new(type: 'text/plain', value: 'and easy to do anywhere, even with Ruby')_16mail = SendGrid::Mail.new(from, subject, to, content)_16_16sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])_16response = sg.client.mail._('send').post(request_body: mail.to_json)_16puts response.status_code_16puts response.body_16puts response.headers