A Ruby interface to the SendGrid API.
The SendGrid API is being covered on demand. The next APIs to be supported are the complete Marketing Email API and Mail (Web API).
Check which SendGrid APIs are currently being covered by this gem: https://github.com/renatosnrg/sendgrid-api/wiki/SendGrid-API-Coverage
Add this line to your application's Gemfile:
gem 'sendgrid-api'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sendgrid-api
client = Sendgrid::API::Client.new('YOUR_USER', 'YOUR_KEY')
Get your SendGrid Profile
profile = client.profile.get
Modify your SendGrid Profile
profile = Sendgrid::API::Entities::Profile.new(:first_name => 'Your first name',
:last_name => 'Your last name')
response = client.profile.set(profile)
Get Advanced Statistics
stats = client.stats.advanced(:start_date => '2013-01-01', :data_type => 'global')
If you want to contribute to cover more APIs or improve something already implemented, follow these steps:
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes - do not forget tests (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request