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!
# using SendGrid's Ruby Library # https://github.com/sendgrid/sendgrid-ruby require 'sendgrid-ruby' include SendGrid from = Email.new(email: 'email@example.com') to = Email.new(email: 'firstname.lastname@example.org') subject = 'Sending with SendGrid is Fun' content = Content.new(type: 'text/plain', value: 'and easy to do anywhere, even with Ruby') mail = Mail.new(from, subject, to, content) sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY']) response = sg.client.mail._('send').post(request_body: mail.to_json) puts response.status_code puts response.body puts response.headers
Let us know how we’re doing! Please rate this page:
Please note, we cannot resolve account and login issues reported on GitHub. Contact support for account assistance.
Thanks for helping us improve our docs!