
[](https://travis-ci.org/SendGrid/smtpapi-ruby)
[](https://badge.fury.io/rb/smtpapi)
[](https://dx.sendgrid.com/newsletter/ruby)
[](https://badge.fury.io/rb/sendgrid-ruby)
[](./LICENSE.txt)
[](https://twitter.com/sendgrid)
[](https://github.com/sendgrid/smtpapi-ruby/graphs/contributors)
**This ruby gem allows you to quickly and more easily generate SendGrid X-SMTPAPI headers.**
# Announcements
**NEW:** If you're a software engineer who is passionate about #DeveloperExperience and/or #OpenSource, [this is an incredible opportunity to join our #DX team](https://sendgrid.com/careers/role/1421152/?gh_jid=1421152) as a Developer Experience Engineer and work with [@thinkingserious](https://github.com/thinkingserious) and [@aroach](https://github.com/aroach)! Tell your friends :)
All updates to this library is documented in our [CHANGELOG](https://github.com/sendgrid/smtpapi-ruby/blob/master/CHANGELOG.md).
# Table of Contents
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Usage](#usage)
- [Roadmap](#roadmap)
- [How to Contribute](#contribute)
- [About](#about)
- [License](#license)
# Installation
## Prerequisites
- Ruby version 2.2
- The SendGrid service, starting at the [free level](https://sendgrid.com/free?source=smtpapi-ruby)
## Install Package
Add this line to your application's Gemfile:
```bash
gem 'smtpapi'
```
And then execute:
```bash
bundle
```
Or install it yourself as:
```bash
gem install smtpapi
```
## Setup Environment Variables
### Environment Variable
Update the development environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys), for example:
```bash
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
echo "sendgrid.env" >> .gitignore
source ./sendgrid.env
```
# Quick Start
```ruby
header = Smtpapi::Header.new
header.add_to('test@example.com')
print header.to_json
```
# Usage
- [SendGrid Docs](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html)
- [Example Code](https://github.com/sendgrid/smtpapi-ruby/blob/master/examples)
# Roadmap
If you are interested in the future direction of this project, please take a look at our [milestones](https://github.com/sendgrid/smtpapi-ruby/milestones). We would love to hear your feedback.
# How to Contribute
We encourage contribution to our libraries, please see our [CONTRIBUTING](https://github.com/sendgrid/smtpapi-ruby/blob/master/CONTRIBUTING.md) guide for details.
Quick links:
- [Feature Request](https://github.com/sendgrid/smtpapi-ruby/blob/master/CONTRIBUTING.md#feature_request)
- [Bug Reports](https://github.com/sendgrid/smtpapi-ruby/blob/master/CONTRIBUTING.md#submit_a_bug_report)
- [Sign the CLA to Create a Pull Request](https://github.com/sendgrid/smtpapi-ruby/blob/master/CONTRIBUTING.md#cla)
- [Improvements to the Codebase](https://github.com/sendgrid/smtpapi-ruby/blob/master/CONTRIBUTING.md#improvements_to_the_codebase)
## Credits
This library was created by [Wataru Sato](https://github.com/awwa) and is now maintained by SendGrid.
# About
smtpapi-ruby is guided and supported by the SendGrid [Developer Experience Team](mailto:dx@sendgrid.com).
smtpapi-ruby is maintained and funded by SendGrid, Inc. The names and logos for smtpapi-ruby are trademarks of SendGrid, Inc.
# License
[The MIT License (MIT)](LICENSE.txt)