A summary of data about the Ruby ecosystem.

https://github.com/sendgrid/sendgrid-ruby

The Official Twilio SendGrid Led, Community Driven Ruby API Library
https://github.com/sendgrid/sendgrid-ruby

Keywords

email ruby sendgrid transactional-emails

Keywords from Contributors

twilio twilio-api twiml activerecord rubygems activejob mvc crash-reporting devise omniauth

Last synced: about 8 hours ago
JSON representation

Repository metadata

The Official Twilio SendGrid Led, Community Driven Ruby API Library

README.md

Twilio SendGrid Logo

Travis Badge
Gem Version
MIT licensed
Twitter Follow
GitHub contributors
Open Source Helpers

This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via Ruby.

Version 3.X.X+ of this library provides full support for all Twilio SendGrid Web API v3 endpoints, including the new v3 /mail/send.

This library represents the beginning of a new path for Twilio SendGrid. We want this library to be community driven and Twilio SendGrid led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create issues and pull requests or simply upvote or comment on existing issues or pull requests.

If you need help using SendGrid, please check the Twilio SendGrid Support Help Center.

Table of Contents

Installation

Prerequisites

  • Ruby version >= 2.4 (except version 2.6.0)
  • The Twilio SendGrid service, starting at the free level

Setup Environment Variables

Update the development environment with your SENDGRID_API_KEY, for example:

echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
echo "sendgrid.env" >> .gitignore
source ./sendgrid.env

Install Package

Add this line to your application's Gemfile:

gem 'sendgrid-ruby'

And then execute:

bundle

Or install it yourself using:

gem install sendgrid-ruby

Dependencies

Quick Start

Hello Email

The following is the minimum needed code to send an email with the /mail/send Helper (here is a full example):

With Mail Helper Class

require 'sendgrid-ruby'
include SendGrid

from = SendGrid::Email.new(email: 'test@example.com')
to = SendGrid::Email.new(email: 'test@example.com')
subject = 'Sending with Twilio SendGrid is Fun'
content = SendGrid::Content.new(type: 'text/plain', value: 'and easy to do anywhere, even with Ruby')
mail = SendGrid::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.parsed_body
puts response.headers

For more complex scenarios, please do not use the above constructor and instead build your own personalization object as demonstrated here.

Without Mail Helper Class

The following is the minimum needed code to send an email without the /mail/send Helper (here is a full example):

require 'sendgrid-ruby'
include SendGrid

data = JSON.parse('{
  "personalizations": [
    {
      "to": [
        {
          "email": "test@example.com"
        }
      ],
      "subject": "Sending with Twilio SendGrid is Fun"
    }
  ],
  "from": {
    "email": "test@example.com"
  },
  "content": [
    {
      "type": "text/plain",
      "value": "and easy to do anywhere, even with Ruby"
    }
  ]
}')
sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
response = sg.client.mail._("send").post(request_body: data)
puts response.status_code
puts response.body
puts response.parsed_body
puts response.headers

General v3 Web API Usage (With Fluent Interface)

require 'sendgrid-ruby'
sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
response = sg.client.suppression.bounces.get()
puts response.status_code
puts response.body
puts response.parsed_body
puts response.headers

General v3 Web API Usage (Without Fluent Interface)

require 'sendgrid-ruby'
sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
response = sg.client._("suppression/bounces").get()
puts response.status_code
puts response.body
puts response.parsed_body
puts response.headers

Processing Inbound Email

Please see our helper for utilizing our Inbound Parse webhook.

Usage

Use Cases

Examples of common API use cases, such as how to send an email with a transactional template.

Announcements

All updates to this library are documented in our CHANGELOG and releases.

How to Contribute

We encourage contribution to our libraries (you might even score some nifty swag), please see our CONTRIBUTING guide for details.

Troubleshooting

Please see our troubleshooting guide for common library issues.

About

sendgrid-ruby is maintained and funded by Twilio SendGrid, Inc. The names and logos for sendgrid-ruby are trademarks of Twilio SendGrid, Inc.

If you need help using SendGrid, please check the Twilio SendGrid Support Help Center.

License

The MIT License (MIT)


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 2 days ago

Total Commits: 552
Total Committers: 96
Avg Commits per committer: 5.75
Development Distribution Score (DDS): 0.71

Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
Elmer Thomas e****r@t****m 160
Twilio t****i@t****m 53
Eddie Zaneski e****e@g****m 41
Sam Harrison s****n@t****m 40
rbin me@r****o 29
Twilio t****b@t****m 20
Jake Yesbeck j****e@a****m 17
awwa500@gmail.com a****0@g****m 17
alanunruh a****h@g****m 13
kernkw k****n@g****m 10
Elise Shanholtz e****z@t****m 8
GustavoCaso g****o@g****m 7
Manjiri Tapaswi m****w@n****u 6
Billy Watson w****n@g****m 5
Shwetha Radhakrishna s****e 5
Kyle Roberts e****l@k****g 4
Ryunosuke Sato t****s@g****m 4
thepriefy p****m@h****m 4
chandler c****r@c****m 4
af4ro 1****l@g****m 4
Matt Bernier m****r@s****m 4
tkbky k****g@t****g 3
Cícero Pablo c****s@g****m 3
Dylan d****h@g****m 3
Mike de Bock m****k@m****l 3
Sebastian Skałacki s****e@g****m 3
rahul26goyal g****l@g****m 2
pushkyn a****n@g****m 2
colto c****c@g****m 2
Tom Lehman t****n@g****m 2
and 66 more...

Committer domains:


Issue and Pull Request metadata

Last synced: 16 days ago

Total issues: 6
Total pull requests: 113
Average time to close issues: about 6 hours
Average time to close pull requests: 10 months
Total issue authors: 6
Total pull request authors: 71
Average comments per issue: 1.83
Average comments per pull request: 1.38
Merged pull request: 63
Bot issues: 0
Bot pull requests: 0

Past year issues: 2
Past year pull requests: 2
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 2
Past year pull request authors: 1
Past year average comments per issue: 0.0
Past year average comments per pull request: 0.0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/sendgrid/sendgrid-ruby

Top Issue Authors

  • ManuelSaleta (1)
  • gotchahn (1)
  • fangbyte (1)
  • utkarsh1996 (1)
  • campgurus (1)
  • reedperkins (1)

Top Pull Request Authors

  • thinkingserious (12)
  • childish-sambino (10)
  • eshanholtz (4)
  • kylearoberts (3)
  • shwetha-manvinkurke (3)
  • beebzz (3)
  • fkmy (2)
  • grin (2)
  • andrii-baran-nfgp (2)
  • douglaslise (2)
  • RolandBurrows (2)
  • kplimack (2)
  • dhoeric (2)
  • renshuki (2)
  • dipil-saud (2)

Top Issue Labels

  • type: question (1)
  • status: waiting for feedback (1)
  • type: bug (1)

Top Pull Request Labels

  • status: code review request (65)
  • difficulty: medium (17)
  • difficulty: easy (14)
  • status: duplicate (5)
  • type: twilio enhancement (5)
  • type: community enhancement (4)
  • difficulty: hard (4)
  • status: waiting for feedback (3)
  • type: docs update (3)
  • status: wontfix (2)
  • status: ready for deploy (2)
  • type: question (1)
  • type: bug (1)

Package metadata

gem.coop: sendgrid-ruby

Official Twilio SendGrid Gem to Interact with Twilio SendGrids API in native Ruby

  • Homepage: http://github.com/sendgrid/sendgrid-ruby
  • Documentation: http://www.rubydoc.info/gems/sendgrid-ruby/
  • Licenses: MIT
  • Latest release: 6.7.0 (published over 2 years ago)
  • Last Synced: 2026-03-02T17:33:51.010Z (1 day ago)
  • Versions: 67
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 54,344,092 Total
  • Docker Downloads: 454
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 0.165%
    • Downloads: 0.496%
  • Maintainers (1)
rubygems.org: sendgrid-ruby

Official Twilio SendGrid Gem to Interact with Twilio SendGrids API in native Ruby

  • Homepage: http://github.com/sendgrid/sendgrid-ruby
  • Documentation: http://www.rubydoc.info/gems/sendgrid-ruby/
  • Licenses: MIT
  • Latest release: 6.7.0 (published over 2 years ago)
  • Last Synced: 2026-03-02T20:30:43.120Z (1 day ago)
  • Versions: 67
  • Dependent Packages: 23
  • Dependent Repositories: 1,449
  • Downloads: 54,354,458 Total
  • Docker Downloads: 454
  • Rankings:
    • Downloads: 0.555%
    • Dependent repos count: 0.82%
    • Dependent packages count: 1.079%
    • Average: 1.456%
    • Forks count: 1.478%
    • Stargazers count: 2.284%
    • Docker downloads count: 2.521%
  • Maintainers (1)
proxy.golang.org: github.com/sendgrid/sendgrid-ruby

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/sendgrid/sendgrid-ruby#section-documentation
  • Licenses: mit
  • Latest release: v6.0.0+incompatible (published over 6 years ago)
  • Last Synced: 2026-02-28T19:00:45.808Z (3 days ago)
  • Versions: 40
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 5.442%
    • Average: 5.624%
    • Dependent repos count: 5.807%

Dependencies

Gemfile rubygems
  • ruby_http_client >= 0
sendgrid-ruby.gemspec rubygems
  • faker >= 0 development
  • minitest ~> 5.9 development
  • pry >= 0 development
  • rack >= 0 development
  • rake ~> 13.0 development
  • rspec >= 0 development
  • simplecov ~> 0.18.5 development
  • sinatra >= 1.4.7, < 3 development
  • ruby_http_client ~> 3.4
.github/workflows/pr-lint.yml actions
  • amannn/action-semantic-pull-request v4 composite
.github/workflows/test-and-deploy.yml actions
  • actions/checkout v2 composite
  • docker/login-action v1 composite
  • rtCamp/action-slack-notify v2 composite
  • ruby/setup-ruby v1 composite
  • sendgrid/dx-automator/actions/datadog-release-metric main composite
  • sendgrid/dx-automator/actions/release main composite
Dockerfile docker
  • $version latest build

Score: 29.569748870915916