sendgrid-ruby 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +17 -6
- data/lib/sendgrid/mail.rb +1 -1
- data/lib/sendgrid/version.rb +1 -1
- data/spec/lib/sendgrid/client_spec.rb +2 -2
- data/spec/lib/sendgrid_spec.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6430c97ce833bb11b86ed69d969f9f37dca211cf
|
4
|
+
data.tar.gz: 54d826be8c3d7d4533166e2cbf0fd5bf4b85567f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99daaa4e54c8f71f2d127201d9c08e9f102008b8d13ff1f71f20d460db728101260a5b6ffd95e41a67cf10baa9b9466c36a9beb888feff75b395a591911b10a4
|
7
|
+
data.tar.gz: fef29993e6322e3b838e52639a7ca3573b7acd5e28303868a8551cde06071a2244620a0db344b8b27439376fb4f3e79dc8de1539c92c583dbbe28ba666aea618
|
data/CHANGELOG.md
ADDED
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
|
-
|
56
|
-
|
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
|
-
|
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
|
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]
|
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
|
|
data/lib/sendgrid/version.rb
CHANGED
@@ -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
|
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
|
data/spec/lib/sendgrid_spec.rb
CHANGED
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.
|
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-
|
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
|