sendgrid-ruby 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe36a0b285a30dfac2804d6f3ac46d3ee0562a67
4
- data.tar.gz: 1dab6a58bc0f677a75cce07a459afa925561db3f
3
+ metadata.gz: 6430c97ce833bb11b86ed69d969f9f37dca211cf
4
+ data.tar.gz: 54d826be8c3d7d4533166e2cbf0fd5bf4b85567f
5
5
  SHA512:
6
- metadata.gz: 4a21dacb775797d79fc03f3b21eef8dff075cce772e14f7a7de4c29c79deb1274ce0dc471e435bc5543d7cb2d7aa700be8528cfbc459011cc0607867ed9b45be
7
- data.tar.gz: bc714d2321f8d349b6388025f0f669113f5437ebd06a336b294bbc36096e3c9d6933b5e795f30c811216979961e7da2e8d4f7ac3a5002dd6574c9367b3de95ab
6
+ metadata.gz: 99daaa4e54c8f71f2d127201d9c08e9f102008b8d13ff1f71f20d460db728101260a5b6ffd95e41a67cf10baa9b9466c36a9beb888feff75b395a591911b10a4
7
+ data.tar.gz: fef29993e6322e3b838e52639a7ca3573b7acd5e28303868a8551cde06071a2244620a0db344b8b27439376fb4f3e79dc8de1539c92c583dbbe28ba666aea618
data/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ ## [1.0.3] - 2015-10-01
5
+ ### Fixed
6
+ Payload 'to' attribute fix for smtpapi
data/README.md CHANGED
@@ -52,15 +52,20 @@ mail = SendGrid::Mail.new do |m|
52
52
  m.text = 'I heard you like pineapple.'
53
53
  end
54
54
 
55
- puts client.send(mail)
56
- # {"message":"success"}
55
+ res = client.send(mail)
56
+ puts res.code
57
+ puts res.body
58
+ # 200
59
+ # {"message"=>"success"}
57
60
  ```
58
61
 
59
62
  You can also create a Mail object with a hash:
60
63
  ```ruby
61
- client.send(SendGrid::Mail.new(to: 'example@example.com', from: 'taco@cat.limo', subject: 'Hello world!', text: 'Hi there!', html: '<b>Hi there!</b>'))
62
-
63
- # {"message":"success"}
64
+ res = client.send(SendGrid::Mail.new(to: 'example@example.com', from: 'taco@cat.limo', subject: 'Hello world!', text: 'Hi there!', html: '<b>Hi there!</b>'))
65
+ puts res.code
66
+ puts res.body
67
+ # 200
68
+ # {"message"=>"success"}
64
69
  ```
65
70
 
66
71
  #### Attachments
@@ -196,7 +201,13 @@ mail.smtpapi = header
196
201
 
197
202
  ## Deploying ##
198
203
 
199
- `rake release`
204
+ 1. Confirm tests pass `bundle exec rake test`
205
+ 2. Bump the version in `lib/sendgrid/version.rb` and `spec/lib/sendgrid_spec.rb`
206
+ 3. Update CHANGELOG.md
207
+ 4. Commit Version bump vX.X.X
208
+ 5. `rake release`
209
+ 6. Push changes to GitHub
210
+ 7. Release tag on GitHub vX.X.X
200
211
 
201
212
  ## Contributing ##
202
213
 
data/lib/sendgrid/mail.rb CHANGED
@@ -131,7 +131,7 @@ module SendGrid
131
131
 
132
132
  payload.delete(:'x-smtpapi') if payload[:'x-smtpapi'] == '{}'
133
133
 
134
- payload[:to] = payload[:from] unless (not payload[:to].nil?) && smtpapi.to.empty?
134
+ payload[:to] = payload[:from] if payload[:to].nil? and not smtpapi.to.empty?
135
135
 
136
136
  return payload if attachments.empty?
137
137
 
@@ -1,3 +1,3 @@
1
1
  module SendGrid
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
@@ -54,10 +54,10 @@ describe 'SendGrid::Client' do
54
54
  client = SendGrid::Client.new(api_user: 'foobar', api_key: 'abc123')
55
55
  mail = SendGrid::Mail.new
56
56
 
57
- client.send(mail)
57
+ res = client.send(mail)
58
58
 
59
59
  expect(WebMock).to have_requested(:post, 'https://api.sendgrid.com/api/mail.send.json')
60
- .with(body: 'api_key=abc123&api_user=foobar&to=')
60
+ .with(body: 'api_key=abc123&api_user=foobar')
61
61
  end
62
62
 
63
63
  it 'should raise a SendGrid::Exception if status is not 200' do
@@ -2,6 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  describe 'SendGrid' do
4
4
  it 'should have a version' do
5
- expect(SendGrid::VERSION).to eq('1.0.2')
5
+ expect(SendGrid::VERSION).to eq('1.0.3')
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendgrid-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robin Johnson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-25 00:00:00.000000000 Z
12
+ date: 2015-10-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: smtpapi
@@ -204,6 +204,7 @@ files:
204
204
  - ".rspec"
205
205
  - ".rubocop.yml"
206
206
  - ".travis.yml"
207
+ - CHANGELOG.md
207
208
  - Gemfile
208
209
  - Guardfile
209
210
  - LICENSE.txt