sendgrid-ruby 3.0.6 → 3.0.7

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: d87e0ebd7948408c1716659ae622d2be7f95f59a
4
- data.tar.gz: bc8f0d2d86daa5fea84161a044aac3f0960825cf
3
+ metadata.gz: f2e4c4f609ac09eee2af7a117a7e149d322229f2
4
+ data.tar.gz: 0322d3868fbc93f37f4f1b2ae410ed5cf7d9a9e6
5
5
  SHA512:
6
- metadata.gz: dd419b14d5b9b113b7860a4dc0683c70cb051dfa6494d225b28c6998b12b1dc025ab3fc53dce71a962044dc8dce15d23b815b4d3ec503d9f6d35d0978a9ccb64
7
- data.tar.gz: e651ea89308ba59e482cd6fdc26058a3638a9ff0cc692daa294f2078c53e0c01040fd9d75a1c874c86fda2dcc4151dd29aeac8c99227c363de19ac56c8372b8d
6
+ metadata.gz: 22d6d4a1ed6f4d5f402e0b179d18a7632851c94fb62b19a04150a8c006a51509abb6bfca3929f98f5497470464c503e7c5e44f18ed8d7de2165c2c562f5d3d34
7
+ data.tar.gz: 74fc4c64185b74b97b89173ae1f24424544bb7fcf75760707ddbb2ee2da3a81e2aba00177ec002088a88631eb3e81c4f48d544f33dc801cc06aa7cd707074ed0
@@ -1,6 +1,13 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [3.0.7] - 2016-07-20 ##
5
+ ### Added
6
+ - README updates
7
+ - Update introduction blurb to include information regarding our forward path
8
+ - Update the v3 /mail/send example to include non-helper usage
9
+ - Update the generic v3 example to include non-fluent interface usage
10
+
4
11
  ## [3.0.6] - 2016-07-05 ##
5
12
  ### Added
6
13
  - Update docs, unit tests and examples to include Sender ID
@@ -64,7 +64,7 @@ We welcome direct contributions to the sendgrid-ruby code base. Thank you!
64
64
 
65
65
  ##### Prerequisites #####
66
66
 
67
- - Ruby 2.2
67
+ - Ruby version 2.2
68
68
  - [ruby_http_client](https://github.com/sendgrid/ruby-http-client)
69
69
 
70
70
  ##### Initial setup: #####
data/README.md CHANGED
@@ -1,36 +1,26 @@
1
1
  [![Travis Badge](https://travis-ci.org/sendgrid/sendgrid-ruby.svg?branch=master)](https://travis-ci.org/sendgrid/sendgrid-ruby)
2
2
 
3
3
 
4
- **This library allows you to quickly and easily use the SendGrid Web API via Ruby.**
4
+ **This library allows you to quickly and easily use the SendGrid Web API v3 via Ruby.**
5
5
 
6
- # Announcements
7
-
8
- **BREAKING CHANGE as of 2016.06.14**
6
+ Version 3.X.X of this library provides full support for all 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).
9
7
 
10
- Version `3.X.X` is a breaking change for the entire library.
8
+ This library represents the beginning of a new path for SendGrid. We want this library to be community driven and 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](https://github.com/sendgrid/sendgrid-ruby/blob/master/CONTRIBUTING.md) or simply upvote or comment on existing issues or pull requests.
11
9
 
12
- Version 3.X.X brings you full support for all Web API v3 endpoints. We
13
- have the following resources to get you started quickly:
10
+ Please browse the rest of this README for further detail.
14
11
 
15
- - [SendGrid
16
- Documentation](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html)
17
- - [Usage
18
- Documentation](https://github.com/sendgrid/sendgrid-ruby/tree/master/USAGE.md)
19
- - [Example
20
- Code](https://github.com/sendgrid/sendgrid-ruby/tree/master/examples)
21
- - [Migration from v2 to v3](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/how_to_migrate_from_v2_to_v3_mail_send.html)
12
+ We appreciate your continued support, thank you!
22
13
 
23
- Thank you for your continued support!
14
+ # Installation
24
15
 
25
- All updates to this library is documented in our [CHANGELOG](https://github.com/sendgrid/sendgrid-ruby/blob/master/CHANGELOG.md).
16
+ ## Prerequisites
26
17
 
27
- # Installation
18
+ - Ruby version 2.2
19
+ - The SendGrid service, starting at the [free level](https://sendgrid.com/free?source=sendgrid-ruby)
28
20
 
29
21
  ## Setup Environment Variables
30
22
 
31
- First, get your free SendGrid account [here](https://sendgrid.com/free?source=sendgrid-ruby).
32
-
33
- Next, update your environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys).
23
+ Update the development environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys), for example:
34
24
 
35
25
  ```bash
36
26
  echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
@@ -59,21 +49,24 @@ gem install sendgrid-ruby
59
49
 
60
50
  ## Dependencies
61
51
 
62
- - The SendGrid Service, starting at the [free level](https://sendgrid.com/free?source=sendgrid-ruby)
63
52
  - [Ruby-HTTP-Client](https://github.com/sendgrid/ruby-http-client)
64
53
 
65
54
  # Quick Start
66
55
 
67
56
  ## Hello Email
68
57
 
58
+ The following is the minimum needed code to send an email with the [/mail/send Helper](https://github.com/sendgrid/sendgrid-ruby/tree/master/lib/sendgrid/helpers/mail) ([here](https://github.com/sendgrid/sendgrid-ruby/blob/master/examples/helpers/mail/example.rb#L21) is a full example):
59
+
60
+ ### With Mail Helper Class
61
+
69
62
  ```ruby
70
63
  require 'sendgrid-ruby'
71
64
  include SendGrid
72
65
 
73
66
  from = Email.new(email: 'test@example.com')
74
- subject = 'Hello World from the SendGrid Ruby Library'
67
+ subject = 'Hello World from the SendGrid Ruby Library!'
75
68
  to = Email.new(email: 'test@example.com')
76
- content = Content.new(type: 'text/plain', value: 'some text here')
69
+ content = Content.new(type: 'text/plain', value: 'Hello, Email!')
77
70
  mail = Mail.new(from, subject, to, content)
78
71
 
79
72
  sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
@@ -83,12 +76,57 @@ puts response.body
83
76
  puts response.headers
84
77
  ```
85
78
 
86
- ## General v3 Web API Usage
79
+ For more complex scenarios, please do not use the above constructor and instead build your own personalization object as [demonstrated here](https://github.com/sendgrid/sendgrid-ruby/blob/master/examples/helpers/mail/example.rb#L21).
80
+
81
+ ### Without Mail Helper Class
82
+
83
+ The following is the minimum needed code to send an email without the /mail/send Helper ([here](https://github.com/sendgrid/sendgrid-ruby/blob/master/examples/mail/mail.rb#L26) is a full example):
84
+
85
+ ```ruby
86
+ data = JSON.parse('{
87
+ "personalizations": [
88
+ {
89
+ "to": [
90
+ {
91
+ "email": "test@example.com"
92
+ }
93
+ ],
94
+ "subject": "Hello World from the SendGrid Ruby Library!"
95
+ }
96
+ ],
97
+ "from": {
98
+ "email": "test@example.com"
99
+ },
100
+ "content": [
101
+ {
102
+ "type": "text/plain",
103
+ "value": "Hello, Email!"
104
+ }
105
+ ]
106
+ }')
107
+ response = sg.client.mail._("send").post(request_body: data)
108
+ puts response.status_code
109
+ puts response.body
110
+ puts response.headers
111
+ ```
112
+
113
+ ## General v3 Web API Usage (With Fluent Interface)
114
+
115
+ ```ruby
116
+ require 'sendgrid-ruby'
117
+ sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
118
+ response = sg.client.suppression.bounces.get()
119
+ puts response.status_code
120
+ puts response.body
121
+ puts response.headers
122
+ ```
123
+
124
+ ## General v3 Web API Usage (Without Fluent Interface)
87
125
 
88
126
  ```ruby
89
127
  require 'sendgrid-ruby'
90
128
  sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
91
- response = sg.client.api_keys.get()
129
+ response = sg.client._("suppression/bounces").get()
92
130
  puts response.status_code
93
131
  puts response.body
94
132
  puts response.headers
@@ -97,17 +135,22 @@ puts response.headers
97
135
  # Usage
98
136
 
99
137
  - [SendGrid Docs](https://sendgrid.com/docs/API_Reference/index.html)
100
- - [Usage Docs](https://github.com/sendgrid/sendgrid-ruby/tree/master/USAGE.md)
138
+ - [Library Usage Docs](https://github.com/sendgrid/sendgrid-ruby/tree/master/USAGE.md)
101
139
  - [Example Code](https://github.com/sendgrid/sendgrid-ruby/tree/master/examples)
140
+ - [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)
141
+ - [v3 Web API Mail Send Helper](https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/mail) - build a request object payload for a v3 /mail/send API call.
142
+
143
+ # Announcements
144
+
145
+ All updates to this library is documented in our [CHANGELOG](https://github.com/sendgrid/sendgrid-ruby/blob/master/CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-ruby/releases).
102
146
 
103
- ## Roadmap
147
+ # Roadmap
104
148
 
105
- If you are interested in the future direction of this project, please take a look at our [milestones](
106
- ). We would love to hear your feedback.
149
+ If you are interested in the future direction of this project, please take a look at our open [issues](https://github.com/sendgrid/sendgrid-ruby/issues) and [pull requests](https://github.com/sendgrid/sendgrid-ruby/pulls). We would love to hear your feedback.
107
150
 
108
- ## How to Contribute
151
+ # How to Contribute
109
152
 
110
- We encourage contribution to our libraries, please see our [CONTRIBUTING](https://github.com/sendgrid/sendgrid-ruby/tree/master/CONTRIBUTING.md) guide for details.
153
+ We encourage contribution to our libraries (you might even score some nifty swag), please see our [CONTRIBUTING](https://github.com/sendgrid/sendgrid-ruby/tree/master/CONTRIBUTING.md) guide for details.
111
154
 
112
155
  - [Feature Request](https://github.com/sendgrid/sendgrid-ruby/tree/master/CONTRIBUTING.md#feature_request)
113
156
  - [Bug Reports](https://github.com/sendgrid/sendgrid-ruby/tree/master/CONTRIBUTING.md#submit_a_bug_report)
data/USAGE.md CHANGED
@@ -2086,7 +2086,7 @@ For more detailed information about how to use the v3 Mail Send endpoint, please
2086
2086
 
2087
2087
  ### POST /mail/send
2088
2088
 
2089
- This endpoint has a helper, check it out [here](https://github.com/sendgrid/sendgrid-ruby/blob/master/lib/helpers/mail/README.md).
2089
+ This endpoint has a helper, check it out [here](https://github.com/sendgrid/sendgrid-ruby/blob/master/lib/sendgrid/helpers/mail/README.md).
2090
2090
 
2091
2091
  ```ruby
2092
2092
  data = JSON.parse('{
@@ -1,3 +1,3 @@
1
1
  module SendGrid
2
- VERSION = '3.0.6'
2
+ VERSION = '3.0.7'
3
3
  end
@@ -30,7 +30,7 @@ class TestAPI < Minitest::Test
30
30
  ')
31
31
  assert_equal(test_headers, sg.request_headers)
32
32
  assert_equal("v3", sg.version)
33
- assert_equal("3.0.6", SendGrid::VERSION)
33
+ assert_equal("3.0.7", SendGrid::VERSION)
34
34
  assert_instance_of(SendGrid::Client, sg.client)
35
35
  end
36
36
 
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: 3.0.6
4
+ version: 3.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elmer Thomas
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-07-12 00:00:00.000000000 Z
13
+ date: 2016-07-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ruby_http_client