{"id":13879990,"url":"https://github.com/sendgrid/sendgrid-ruby","last_synced_at":"2025-05-14T07:08:16.387Z","repository":{"id":17802168,"uuid":"20687208","full_name":"sendgrid/sendgrid-ruby","owner":"sendgrid","description":"The Official Twilio SendGrid Led, Community Driven Ruby API Library","archived":false,"fork":false,"pushed_at":"2024-08-02T04:04:47.000Z","size":1038,"stargazers_count":631,"open_issues_count":28,"forks_count":324,"subscribers_count":203,"default_branch":"main","last_synced_at":"2025-04-26T05:09:59.451Z","etag":null,"topics":["email","ruby","sendgrid","transactional-emails"],"latest_commit_sha":null,"homepage":"https://sendgrid.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sendgrid.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-06-10T13:56:38.000Z","updated_at":"2025-04-24T10:50:07.000Z","dependencies_parsed_at":"2024-10-20T11:38:50.884Z","dependency_job_id":null,"html_url":"https://github.com/sendgrid/sendgrid-ruby","commit_stats":{"total_commits":552,"total_committers":102,"mean_commits":5.411764705882353,"dds":0.8586956521739131,"last_synced_commit":"02b6a2a46dbf38c53a6dd8469f5da69a55c78a47"},"previous_names":[],"tags_count":69,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sendgrid%2Fsendgrid-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sendgrid%2Fsendgrid-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sendgrid%2Fsendgrid-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sendgrid%2Fsendgrid-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sendgrid","download_url":"https://codeload.github.com/sendgrid/sendgrid-ruby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251094583,"owners_count":21535324,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["email","ruby","sendgrid","transactional-emails"],"created_at":"2024-08-06T08:02:42.447Z","updated_at":"2025-05-14T07:08:16.365Z","avatar_url":"https://github.com/sendgrid.png","language":"Ruby","readme":"![Twilio SendGrid Logo](twilio_sendgrid_logo.png)\n\n[![Travis Badge](https://github.com/sendgrid/sendgrid-ruby/actions/workflows/test-and-deploy.yml/badge.svg)](https://github.com/sendgrid/sendgrid-ruby/actions/workflows/test-and-deploy.yml)\n[![Gem Version](https://badge.fury.io/rb/sendgrid-ruby.svg)](https://badge.fury.io/rb/sendgrid-ruby)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social\u0026label=Follow)](https://twitter.com/sendgrid)\n[![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/sendgrid-ruby.svg)](https://github.com/sendgrid/sendgrid-ruby/graphs/contributors)\n[![Open Source Helpers](https://www.codetriage.com/sendgrid/sendgrid-ruby/badges/users.svg)](https://www.codetriage.com/sendgrid/sendgrid-ruby)\n\n**This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via Ruby.**\n\nVersion 3.X.X+ of this library provides full support for all Twilio SendGrid [Web API v3](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html) endpoints, including the new [v3 /mail/send](https://sendgrid.com/blog/introducing-v3mailsend-sendgrids-new-mail-endpoint).\n\nThis 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](https://github.com/sendgrid/sendgrid-ruby/issues) and [pull requests](CONTRIBUTING.md) or simply upvote or comment on existing issues or pull requests.\n\n**If you need help using SendGrid, please check the [Twilio SendGrid Support Help Center](https://support.sendgrid.com).**\n\n# Table of Contents\n\n* [Announcements](#announcements)\n* [Installation](#installation)\n* [Quick Start](#quick-start)\n* [Processing Inbound Email](#inbound)\n* [Usage](#usage)\n* [Use Cases](#use_cases)\n* [Announcements](#announcements)\n* [How to Contribute](#contribute)\n* [Troubleshooting](#troubleshooting)\n* [About](#about)\n* [Support](#support)\n* [License](#license)\n\n\u003ca name=\"installation\"\u003e\u003c/a\u003e\n# Installation\n\n## Prerequisites\n\n- Ruby version \u003e= 2.4 (except version [2.6.0](TROUBLESHOOTING.md#ruby-versions))\n- The Twilio SendGrid service, starting at the [free level](https://sendgrid.com/free?source=sendgrid-ruby)\n\n## Setup Environment Variables\n\nUpdate the development environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys), for example:\n\n```bash\necho \"export SENDGRID_API_KEY='YOUR_API_KEY'\" \u003e sendgrid.env\necho \"sendgrid.env\" \u003e\u003e .gitignore\nsource ./sendgrid.env\n```\n## Install Package\n\nAdd this line to your application's Gemfile:\n\n```bash\ngem 'sendgrid-ruby'\n```\n\nAnd then execute:\n\n```bash\nbundle\n```\n\nOr install it yourself using:\n\n```bash\ngem install sendgrid-ruby\n```\n\n## Dependencies\n\n- [Ruby-HTTP-Client](https://github.com/sendgrid/ruby-http-client)\n\n\u003ca name=\"quick-start\"\u003e\u003c/a\u003e\n# Quick Start\n\n## Hello Email\n\nThe following is the minimum needed code to send an email with the [/mail/send Helper](lib/sendgrid/helpers/mail) ([here](examples/helpers/mail/example.rb#L21) is a full example):\n\n### With Mail Helper Class\n\n```ruby\nrequire 'sendgrid-ruby'\ninclude SendGrid\n\nfrom = SendGrid::Email.new(email: 'test@example.com')\nto = SendGrid::Email.new(email: 'test@example.com')\nsubject = 'Sending with Twilio SendGrid is Fun'\ncontent = SendGrid::Content.new(type: 'text/plain', value: 'and easy to do anywhere, even with Ruby')\nmail = SendGrid::Mail.new(from, subject, to, content)\n\nsg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])\nresponse = sg.client.mail._('send').post(request_body: mail.to_json)\nputs response.status_code\nputs response.body\nputs response.parsed_body\nputs response.headers\n```\n\nFor more complex scenarios, please do not use the above constructor and instead build your own personalization object as [demonstrated here](examples/helpers/mail/example.rb#L21).\n\n### Without Mail Helper Class\n\nThe following is the minimum needed code to send an email without the /mail/send Helper ([here](examples/mail/mail.rb#L26) is a full example):\n\n```ruby\nrequire 'sendgrid-ruby'\ninclude SendGrid\n\ndata = JSON.parse('{\n  \"personalizations\": [\n    {\n      \"to\": [\n        {\n          \"email\": \"test@example.com\"\n        }\n      ],\n      \"subject\": \"Sending with Twilio SendGrid is Fun\"\n    }\n  ],\n  \"from\": {\n    \"email\": \"test@example.com\"\n  },\n  \"content\": [\n    {\n      \"type\": \"text/plain\",\n      \"value\": \"and easy to do anywhere, even with Ruby\"\n    }\n  ]\n}')\nsg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])\nresponse = sg.client.mail._(\"send\").post(request_body: data)\nputs response.status_code\nputs response.body\nputs response.parsed_body\nputs response.headers\n```\n\n## General v3 Web API Usage (With Fluent Interface)\n\n```ruby\nrequire 'sendgrid-ruby'\nsg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])\nresponse = sg.client.suppression.bounces.get()\nputs response.status_code\nputs response.body\nputs response.parsed_body\nputs response.headers\n```\n\n## General v3 Web API Usage (Without Fluent Interface)\n\n```ruby\nrequire 'sendgrid-ruby'\nsg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])\nresponse = sg.client._(\"suppression/bounces\").get()\nputs response.status_code\nputs response.body\nputs response.parsed_body\nputs response.headers\n```\n\n\u003ca name=\"inbound\"\u003e\u003c/a\u003e\n# Processing Inbound Email\n\nPlease see [our helper](lib/sendgrid/helpers/inbound) for utilizing our Inbound Parse webhook.\n\n\u003ca name=\"usage\"\u003e\u003c/a\u003e\n# Usage\n\n- [Twilio SendGrid Docs](https://sendgrid.com/docs/API_Reference/index.html)\n- [Library Usage Docs](USAGE.md)\n- [Example Code](examples)\n- [How-to: Migration from v2 to v3](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/how_to_migrate_from_v2_to_v3_mail_send.html)\n- [v3 Web API Mail Send Helper](lib/sendgrid/helpers/mail) - build a request object payload for a v3 /mail/send API call.\n- [Settings Helper](lib/sendgrid/helpers/settings)\n\n\u003ca name=\"use_cases\"\u003e\u003c/a\u003e\n# Use Cases\n\n[Examples of common API use cases](use-cases), such as how to send an email with a transactional template.\n\n\u003ca name=\"announcements\"\u003e\u003c/a\u003e\n# Announcements\n\nAll updates to this library are documented in our [CHANGELOG](CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-ruby/releases).\n\n\u003ca name=\"contribute\"\u003e\u003c/a\u003e\n# How to Contribute\n\nWe encourage contribution to our libraries (you might even score some nifty swag), please see our [CONTRIBUTING](CONTRIBUTING.md) guide for details.\n\n- [Feature Request](CONTRIBUTING.md#feature_request)\n- [Bug Reports](CONTRIBUTING.md#submit_a_bug_report)\n- [Improvements to the Codebase](CONTRIBUTING.md#improvements_to_the_codebase)\n- [Review Pull Requests](CONTRIBUTING.md#code-reviews)\n\n\u003ca name=\"troubleshooting\"\u003e\u003c/a\u003e\n# Troubleshooting\n\nPlease see our [troubleshooting guide](TROUBLESHOOTING.md) for common library issues.\n\n\u003ca name=\"about\"\u003e\u003c/a\u003e\n# About\n\nsendgrid-ruby is maintained and funded by Twilio SendGrid, Inc. The names and logos for sendgrid-ruby are trademarks of Twilio SendGrid, Inc.\n\n\u003ca name=\"support\"\u003e\u003c/a\u003e\n\nIf you need help using SendGrid, please check the [Twilio SendGrid Support Help Center](https://support.sendgrid.com).\n\n\u003ca name=\"license\"\u003e\u003c/a\u003e\n# License\n[The MIT License (MIT)](LICENSE)\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsendgrid%2Fsendgrid-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsendgrid%2Fsendgrid-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsendgrid%2Fsendgrid-ruby/lists"}