sendgrid-ruby 1.1.6 → 6.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. checksums.yaml +5 -5
  2. data/.env_sample +1 -3
  3. data/.github/ISSUE_TEMPLATE/config.yml +10 -0
  4. data/.github/workflows/test-and-deploy.yml +120 -0
  5. data/.gitignore +3 -0
  6. data/.rubocop.yml +5 -27
  7. data/.rubocop_todo.yml +127 -0
  8. data/CHANGELOG.md +417 -1
  9. data/CODE_OF_CONDUCT.md +73 -0
  10. data/CONTRIBUTING.md +202 -0
  11. data/Dockerfile +14 -0
  12. data/FIRST_TIMERS.md +79 -0
  13. data/Gemfile +4 -4
  14. data/ISSUE_TEMPLATE.md +30 -0
  15. data/LICENSE +21 -0
  16. data/Makefile +14 -0
  17. data/PULL_REQUEST_TEMPLATE.md +31 -0
  18. data/README.md +153 -229
  19. data/Rakefile +9 -3
  20. data/TROUBLESHOOTING.md +151 -0
  21. data/UPGRADE.md +5 -0
  22. data/USAGE.md +5144 -0
  23. data/config.ru +4 -0
  24. data/examples/accesssettings/accesssettings.rb +80 -0
  25. data/examples/alerts/alerts.rb +59 -0
  26. data/examples/apikeys/apikeys.rb +81 -0
  27. data/examples/asm/asm.rb +170 -0
  28. data/examples/browsers/browsers.rb +13 -0
  29. data/examples/campaigns/campaigns.rb +150 -0
  30. data/examples/categories/categories.rb +33 -0
  31. data/examples/clients/clients.rb +24 -0
  32. data/examples/contactdb/contactdb.rb +392 -0
  33. data/examples/devices/devices.rb +13 -0
  34. data/examples/emailactivity/emailactivity.rb +52 -0
  35. data/examples/geo/geo.rb +13 -0
  36. data/examples/helpers/eventwebhook/example.rb +16 -0
  37. data/examples/helpers/mail/example.rb +158 -0
  38. data/examples/helpers/settings/example.rb +23 -0
  39. data/examples/helpers/stats/example.rb +42 -0
  40. data/examples/ips/ips.rb +164 -0
  41. data/examples/mail/mail.rb +170 -0
  42. data/examples/mailboxproviders/mailboxproviders.rb +13 -0
  43. data/examples/mailsettings/mailsettings.rb +216 -0
  44. data/examples/partnersettings/partnersettings.rb +36 -0
  45. data/examples/scopes/scopes.rb +59 -0
  46. data/examples/senderauthentication/senderauthentication.rb +307 -0
  47. data/examples/senders/senders.rb +95 -0
  48. data/examples/stats/stats.rb +13 -0
  49. data/examples/subusers/subusers.rb +166 -0
  50. data/examples/suppression/suppression.rb +198 -0
  51. data/examples/templates/templates.rb +127 -0
  52. data/examples/trackingsettings/trackingsettings.rb +107 -0
  53. data/examples/user/user.rb +290 -0
  54. data/gemfiles/Sinatra_1.gemfile +6 -0
  55. data/gemfiles/Sinatra_2.gemfile +6 -0
  56. data/lib/rack/sendgrid_webhook_verification.rb +55 -0
  57. data/lib/sendgrid/base_interface.rb +40 -0
  58. data/lib/sendgrid/helpers/eventwebhook/eventwebhook.rb +50 -0
  59. data/lib/sendgrid/helpers/inbound/README.md +98 -0
  60. data/lib/sendgrid/helpers/inbound/app.rb +32 -0
  61. data/lib/sendgrid/helpers/inbound/config.yml +26 -0
  62. data/lib/sendgrid/helpers/inbound/public/index.html +10 -0
  63. data/lib/sendgrid/helpers/inbound/sample_data/default_data.txt +58 -0
  64. data/lib/sendgrid/helpers/inbound/sample_data/raw_data.txt +57 -0
  65. data/lib/sendgrid/helpers/inbound/sample_data/raw_data_with_attachments.txt +298 -0
  66. data/lib/sendgrid/helpers/inbound/send.rb +26 -0
  67. data/lib/sendgrid/helpers/ip_management/ip_management.rb +17 -0
  68. data/lib/sendgrid/helpers/mail/README.md +14 -0
  69. data/lib/sendgrid/helpers/mail/asm.rb +19 -0
  70. data/lib/sendgrid/helpers/mail/attachment.rb +55 -0
  71. data/lib/sendgrid/helpers/mail/bcc_settings.rb +19 -0
  72. data/lib/sendgrid/helpers/mail/bypass_list_management.rb +31 -0
  73. data/lib/sendgrid/helpers/mail/category.rb +18 -0
  74. data/lib/sendgrid/helpers/mail/click_tracking.rb +19 -0
  75. data/lib/sendgrid/helpers/mail/content.rb +19 -0
  76. data/lib/sendgrid/helpers/mail/custom_arg.rb +18 -0
  77. data/lib/sendgrid/helpers/mail/email.rb +32 -0
  78. data/lib/sendgrid/helpers/mail/footer.rb +21 -0
  79. data/lib/sendgrid/helpers/mail/ganalytics.rb +28 -0
  80. data/lib/sendgrid/helpers/mail/header.rb +18 -0
  81. data/lib/sendgrid/helpers/mail/mail.rb +122 -0
  82. data/lib/sendgrid/helpers/mail/mail_settings.rb +45 -0
  83. data/lib/sendgrid/helpers/mail/open_tracking.rb +19 -0
  84. data/lib/sendgrid/helpers/mail/personalization.rb +93 -0
  85. data/lib/sendgrid/helpers/mail/section.rb +18 -0
  86. data/lib/sendgrid/helpers/mail/spam_check.rb +21 -0
  87. data/lib/sendgrid/helpers/mail/subscription_tracking.rb +23 -0
  88. data/lib/sendgrid/helpers/mail/substitution.rb +18 -0
  89. data/lib/sendgrid/helpers/mail/tracking_settings.rb +39 -0
  90. data/lib/sendgrid/helpers/permissions/scope.rb +28 -0
  91. data/lib/sendgrid/helpers/permissions/scopes.yml +309 -0
  92. data/lib/sendgrid/helpers/settings/README.md +14 -0
  93. data/lib/sendgrid/helpers/settings/mail_settings_dto.rb +13 -0
  94. data/lib/sendgrid/helpers/settings/partner_settings_dto.rb +13 -0
  95. data/lib/sendgrid/helpers/settings/settings.rb +28 -0
  96. data/lib/sendgrid/helpers/settings/tracking_settings_dto.rb +22 -0
  97. data/lib/sendgrid/helpers/settings/user_settings_dto.rb +13 -0
  98. data/lib/sendgrid/helpers/stats/email_stats.rb +46 -0
  99. data/lib/sendgrid/helpers/stats/metrics.rb +33 -0
  100. data/lib/sendgrid/helpers/stats/stats_response.rb +29 -0
  101. data/lib/sendgrid/sendgrid.rb +21 -0
  102. data/lib/sendgrid/twilio_email.rb +21 -0
  103. data/lib/sendgrid/version.rb +1 -1
  104. data/lib/sendgrid-ruby.rb +32 -7
  105. data/mail_helper_v3.md +390 -0
  106. data/sendgrid-ruby.gemspec +16 -20
  107. data/spec/fixtures/event_webhook.rb +22 -0
  108. data/spec/rack/sendgrid_webhook_verification_spec.rb +142 -0
  109. data/spec/sendgrid/helpers/eventwebhook/eventwebhook_spec.rb +105 -0
  110. data/spec/sendgrid/helpers/ip_management/ip_management_spec.rb +12 -0
  111. data/spec/sendgrid/helpers/settings/mail_settings_dto_spec.rb +32 -0
  112. data/spec/sendgrid/helpers/settings/partner_settings_dto_spec.rb +24 -0
  113. data/spec/sendgrid/helpers/settings/settings_spec.rb +25 -0
  114. data/spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb +27 -0
  115. data/spec/sendgrid/helpers/settings/user_settings_dto_spec.rb +24 -0
  116. data/spec/sendgrid/helpers/stats/email_stats_spec.rb +111 -0
  117. data/spec/sendgrid/helpers/stats/metrics_spec.rb +45 -0
  118. data/spec/sendgrid/helpers/stats/stats_response_spec.rb +75 -0
  119. data/spec/sendgrid/sendgrid_spec.rb +11 -0
  120. data/spec/sendgrid/twilio_email_spec.rb +11 -0
  121. data/spec/spec_helper.rb +12 -1
  122. data/static/img/github-fork.png +0 -0
  123. data/static/img/github-sign-up.png +0 -0
  124. data/test/sendgrid/helpers/mail/test_attachment.rb +33 -0
  125. data/test/sendgrid/helpers/mail/test_category.rb +25 -0
  126. data/test/sendgrid/helpers/mail/test_email.rb +41 -0
  127. data/test/sendgrid/helpers/mail/test_mail.rb +260 -0
  128. data/test/sendgrid/helpers/mail/test_personalizations.rb +214 -0
  129. data/test/sendgrid/permissions/test_scopes.rb +36 -0
  130. data/test/sendgrid/test_sendgrid-ruby.rb +2729 -0
  131. data/twilio_sendgrid_logo.png +0 -0
  132. data/use-cases/README.md +17 -0
  133. data/use-cases/domain-authentication.md +5 -0
  134. data/use-cases/email-statistics.md +52 -0
  135. data/use-cases/legacy-templates.md +98 -0
  136. data/use-cases/personalizations.md +34 -0
  137. data/use-cases/sms.md +39 -0
  138. data/use-cases/transactional-templates.md +111 -0
  139. data/use-cases/twilio-email.md +13 -0
  140. data/use-cases/twilio-setup.md +54 -0
  141. metadata +187 -112
  142. data/.rspec +0 -2
  143. data/.travis.yml +0 -20
  144. data/FETCH_HEAD +0 -0
  145. data/Guardfile +0 -10
  146. data/LICENSE.txt +0 -22
  147. data/example.rb +0 -41
  148. data/lib/sendgrid/client.rb +0 -62
  149. data/lib/sendgrid/exceptions.rb +0 -7
  150. data/lib/sendgrid/mail.rb +0 -182
  151. data/lib/sendgrid/recipient.rb +0 -29
  152. data/lib/sendgrid/response.rb +0 -14
  153. data/lib/sendgrid/template.rb +0 -26
  154. data/lib/sendgrid/template_mailer.rb +0 -59
  155. data/spec/lib/sendgrid/client_spec.rb +0 -87
  156. data/spec/lib/sendgrid/mail_spec.rb +0 -151
  157. data/spec/lib/sendgrid/recipient_spec.rb +0 -91
  158. data/spec/lib/sendgrid/template_mailer_spec.rb +0 -86
  159. data/spec/lib/sendgrid/template_spec.rb +0 -61
  160. data/spec/lib/sendgrid_spec.rb +0 -7
metadata CHANGED
@@ -1,60 +1,33 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendgrid-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 6.6.2
5
5
  platform: ruby
6
6
  authors:
7
+ - Elmer Thomas
7
8
  - Robin Johnson
8
9
  - Eddie Zaneski
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2015-11-27 00:00:00.000000000 Z
13
+ date: 2022-03-09 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
- name: smtpapi
16
+ name: ruby_http_client
16
17
  requirement: !ruby/object:Gem::Requirement
17
18
  requirements:
18
19
  - - "~>"
19
20
  - !ruby/object:Gem::Version
20
- version: '0.1'
21
+ version: '3.4'
21
22
  type: :runtime
22
23
  prerelease: false
23
24
  version_requirements: !ruby/object:Gem::Requirement
24
25
  requirements:
25
26
  - - "~>"
26
27
  - !ruby/object:Gem::Version
27
- version: '0.1'
28
+ version: '3.4'
28
29
  - !ruby/object:Gem::Dependency
29
- name: faraday
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - "~>"
33
- - !ruby/object:Gem::Version
34
- version: '0.9'
35
- type: :runtime
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - "~>"
40
- - !ruby/object:Gem::Version
41
- version: '0.9'
42
- - !ruby/object:Gem::Dependency
43
- name: mimemagic
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - ">="
47
- - !ruby/object:Gem::Version
48
- version: '0'
49
- type: :runtime
50
- prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- version: '0'
56
- - !ruby/object:Gem::Dependency
57
- name: rake
30
+ name: faker
58
31
  requirement: !ruby/object:Gem::Requirement
59
32
  requirements:
60
33
  - - ">="
@@ -68,21 +41,21 @@ dependencies:
68
41
  - !ruby/object:Gem::Version
69
42
  version: '0'
70
43
  - !ruby/object:Gem::Dependency
71
- name: rspec
44
+ name: minitest
72
45
  requirement: !ruby/object:Gem::Requirement
73
46
  requirements:
74
- - - ">="
47
+ - - "~>"
75
48
  - !ruby/object:Gem::Version
76
- version: '0'
49
+ version: '5.9'
77
50
  type: :development
78
51
  prerelease: false
79
52
  version_requirements: !ruby/object:Gem::Requirement
80
53
  requirements:
81
- - - ">="
54
+ - - "~>"
82
55
  - !ruby/object:Gem::Version
83
- version: '0'
56
+ version: '5.9'
84
57
  - !ruby/object:Gem::Dependency
85
- name: rspec-nc
58
+ name: pry
86
59
  requirement: !ruby/object:Gem::Requirement
87
60
  requirements:
88
61
  - - ">="
@@ -96,7 +69,7 @@ dependencies:
96
69
  - !ruby/object:Gem::Version
97
70
  version: '0'
98
71
  - !ruby/object:Gem::Dependency
99
- name: webmock
72
+ name: rack
100
73
  requirement: !ruby/object:Gem::Requirement
101
74
  requirements:
102
75
  - - ">="
@@ -110,21 +83,21 @@ dependencies:
110
83
  - !ruby/object:Gem::Version
111
84
  version: '0'
112
85
  - !ruby/object:Gem::Dependency
113
- name: guard
86
+ name: rake
114
87
  requirement: !ruby/object:Gem::Requirement
115
88
  requirements:
116
- - - ">="
89
+ - - "~>"
117
90
  - !ruby/object:Gem::Version
118
- version: '0'
91
+ version: '13.0'
119
92
  type: :development
120
93
  prerelease: false
121
94
  version_requirements: !ruby/object:Gem::Requirement
122
95
  requirements:
123
- - - ">="
96
+ - - "~>"
124
97
  - !ruby/object:Gem::Version
125
- version: '0'
98
+ version: '13.0'
126
99
  - !ruby/object:Gem::Dependency
127
- name: guard-rspec
100
+ name: rspec
128
101
  requirement: !ruby/object:Gem::Requirement
129
102
  requirements:
130
103
  - - ">="
@@ -138,97 +111,185 @@ dependencies:
138
111
  - !ruby/object:Gem::Version
139
112
  version: '0'
140
113
  - !ruby/object:Gem::Dependency
141
- name: rubocop
114
+ name: simplecov
142
115
  requirement: !ruby/object:Gem::Requirement
143
116
  requirements:
144
- - - ">="
117
+ - - "~>"
145
118
  - !ruby/object:Gem::Version
146
- version: '0'
119
+ version: 0.18.5
147
120
  type: :development
148
121
  prerelease: false
149
122
  version_requirements: !ruby/object:Gem::Requirement
150
123
  requirements:
151
- - - ">="
124
+ - - "~>"
152
125
  - !ruby/object:Gem::Version
153
- version: '0'
126
+ version: 0.18.5
154
127
  - !ruby/object:Gem::Dependency
155
- name: guard-rubocop
128
+ name: sinatra
156
129
  requirement: !ruby/object:Gem::Requirement
157
130
  requirements:
158
131
  - - ">="
159
132
  - !ruby/object:Gem::Version
160
- version: '0'
161
- type: :development
162
- prerelease: false
163
- version_requirements: !ruby/object:Gem::Requirement
164
- requirements:
165
- - - ">="
133
+ version: 1.4.7
134
+ - - "<"
166
135
  - !ruby/object:Gem::Version
167
- version: '0'
168
- - !ruby/object:Gem::Dependency
169
- name: ruby_gntp
170
- requirement: !ruby/object:Gem::Requirement
171
- requirements:
172
- - - ">="
173
- - !ruby/object:Gem::Version
174
- version: '0'
136
+ version: '3'
175
137
  type: :development
176
138
  prerelease: false
177
139
  version_requirements: !ruby/object:Gem::Requirement
178
140
  requirements:
179
141
  - - ">="
180
142
  - !ruby/object:Gem::Version
181
- version: '0'
182
- - !ruby/object:Gem::Dependency
183
- name: bundler
184
- requirement: !ruby/object:Gem::Requirement
185
- requirements:
186
- - - "~>"
187
- - !ruby/object:Gem::Version
188
- version: '1.6'
189
- type: :development
190
- prerelease: false
191
- version_requirements: !ruby/object:Gem::Requirement
192
- requirements:
193
- - - "~>"
143
+ version: 1.4.7
144
+ - - "<"
194
145
  - !ruby/object:Gem::Version
195
- version: '1.6'
196
- description: Interact with SendGrids API in native Ruby
197
- email: community@sendgrid.com
146
+ version: '3'
147
+ description: Official Twilio SendGrid Gem to Interact with Twilio SendGrids API in
148
+ native Ruby
149
+ email: help@twilio.com
198
150
  executables: []
199
151
  extensions: []
200
152
  extra_rdoc_files: []
201
153
  files:
202
154
  - ".env_sample"
155
+ - ".github/ISSUE_TEMPLATE/config.yml"
156
+ - ".github/workflows/test-and-deploy.yml"
203
157
  - ".gitignore"
204
- - ".rspec"
205
158
  - ".rubocop.yml"
206
- - ".travis.yml"
159
+ - ".rubocop_todo.yml"
207
160
  - CHANGELOG.md
208
- - FETCH_HEAD
161
+ - CODE_OF_CONDUCT.md
162
+ - CONTRIBUTING.md
163
+ - Dockerfile
164
+ - FIRST_TIMERS.md
209
165
  - Gemfile
210
- - Guardfile
211
- - LICENSE.txt
166
+ - ISSUE_TEMPLATE.md
167
+ - LICENSE
168
+ - Makefile
169
+ - PULL_REQUEST_TEMPLATE.md
212
170
  - README.md
213
171
  - Rakefile
214
- - example.rb
172
+ - TROUBLESHOOTING.md
173
+ - UPGRADE.md
174
+ - USAGE.md
175
+ - config.ru
176
+ - examples/accesssettings/accesssettings.rb
177
+ - examples/alerts/alerts.rb
178
+ - examples/apikeys/apikeys.rb
179
+ - examples/asm/asm.rb
180
+ - examples/browsers/browsers.rb
181
+ - examples/campaigns/campaigns.rb
182
+ - examples/categories/categories.rb
183
+ - examples/clients/clients.rb
184
+ - examples/contactdb/contactdb.rb
185
+ - examples/devices/devices.rb
186
+ - examples/emailactivity/emailactivity.rb
187
+ - examples/geo/geo.rb
188
+ - examples/helpers/eventwebhook/example.rb
189
+ - examples/helpers/mail/example.rb
190
+ - examples/helpers/settings/example.rb
191
+ - examples/helpers/stats/example.rb
192
+ - examples/ips/ips.rb
193
+ - examples/mail/mail.rb
194
+ - examples/mailboxproviders/mailboxproviders.rb
195
+ - examples/mailsettings/mailsettings.rb
196
+ - examples/partnersettings/partnersettings.rb
197
+ - examples/scopes/scopes.rb
198
+ - examples/senderauthentication/senderauthentication.rb
199
+ - examples/senders/senders.rb
200
+ - examples/stats/stats.rb
201
+ - examples/subusers/subusers.rb
202
+ - examples/suppression/suppression.rb
203
+ - examples/templates/templates.rb
204
+ - examples/trackingsettings/trackingsettings.rb
205
+ - examples/user/user.rb
206
+ - gemfiles/Sinatra_1.gemfile
207
+ - gemfiles/Sinatra_2.gemfile
208
+ - lib/rack/sendgrid_webhook_verification.rb
215
209
  - lib/sendgrid-ruby.rb
216
- - lib/sendgrid/client.rb
217
- - lib/sendgrid/exceptions.rb
218
- - lib/sendgrid/mail.rb
219
- - lib/sendgrid/recipient.rb
220
- - lib/sendgrid/response.rb
221
- - lib/sendgrid/template.rb
222
- - lib/sendgrid/template_mailer.rb
210
+ - lib/sendgrid/base_interface.rb
211
+ - lib/sendgrid/helpers/eventwebhook/eventwebhook.rb
212
+ - lib/sendgrid/helpers/inbound/README.md
213
+ - lib/sendgrid/helpers/inbound/app.rb
214
+ - lib/sendgrid/helpers/inbound/config.yml
215
+ - lib/sendgrid/helpers/inbound/public/index.html
216
+ - lib/sendgrid/helpers/inbound/sample_data/default_data.txt
217
+ - lib/sendgrid/helpers/inbound/sample_data/raw_data.txt
218
+ - lib/sendgrid/helpers/inbound/sample_data/raw_data_with_attachments.txt
219
+ - lib/sendgrid/helpers/inbound/send.rb
220
+ - lib/sendgrid/helpers/ip_management/ip_management.rb
221
+ - lib/sendgrid/helpers/mail/README.md
222
+ - lib/sendgrid/helpers/mail/asm.rb
223
+ - lib/sendgrid/helpers/mail/attachment.rb
224
+ - lib/sendgrid/helpers/mail/bcc_settings.rb
225
+ - lib/sendgrid/helpers/mail/bypass_list_management.rb
226
+ - lib/sendgrid/helpers/mail/category.rb
227
+ - lib/sendgrid/helpers/mail/click_tracking.rb
228
+ - lib/sendgrid/helpers/mail/content.rb
229
+ - lib/sendgrid/helpers/mail/custom_arg.rb
230
+ - lib/sendgrid/helpers/mail/email.rb
231
+ - lib/sendgrid/helpers/mail/footer.rb
232
+ - lib/sendgrid/helpers/mail/ganalytics.rb
233
+ - lib/sendgrid/helpers/mail/header.rb
234
+ - lib/sendgrid/helpers/mail/mail.rb
235
+ - lib/sendgrid/helpers/mail/mail_settings.rb
236
+ - lib/sendgrid/helpers/mail/open_tracking.rb
237
+ - lib/sendgrid/helpers/mail/personalization.rb
238
+ - lib/sendgrid/helpers/mail/section.rb
239
+ - lib/sendgrid/helpers/mail/spam_check.rb
240
+ - lib/sendgrid/helpers/mail/subscription_tracking.rb
241
+ - lib/sendgrid/helpers/mail/substitution.rb
242
+ - lib/sendgrid/helpers/mail/tracking_settings.rb
243
+ - lib/sendgrid/helpers/permissions/scope.rb
244
+ - lib/sendgrid/helpers/permissions/scopes.yml
245
+ - lib/sendgrid/helpers/settings/README.md
246
+ - lib/sendgrid/helpers/settings/mail_settings_dto.rb
247
+ - lib/sendgrid/helpers/settings/partner_settings_dto.rb
248
+ - lib/sendgrid/helpers/settings/settings.rb
249
+ - lib/sendgrid/helpers/settings/tracking_settings_dto.rb
250
+ - lib/sendgrid/helpers/settings/user_settings_dto.rb
251
+ - lib/sendgrid/helpers/stats/email_stats.rb
252
+ - lib/sendgrid/helpers/stats/metrics.rb
253
+ - lib/sendgrid/helpers/stats/stats_response.rb
254
+ - lib/sendgrid/sendgrid.rb
255
+ - lib/sendgrid/twilio_email.rb
223
256
  - lib/sendgrid/version.rb
257
+ - mail_helper_v3.md
224
258
  - sendgrid-ruby.gemspec
225
- - spec/lib/sendgrid/client_spec.rb
226
- - spec/lib/sendgrid/mail_spec.rb
227
- - spec/lib/sendgrid/recipient_spec.rb
228
- - spec/lib/sendgrid/template_mailer_spec.rb
229
- - spec/lib/sendgrid/template_spec.rb
230
- - spec/lib/sendgrid_spec.rb
259
+ - spec/fixtures/event_webhook.rb
260
+ - spec/rack/sendgrid_webhook_verification_spec.rb
261
+ - spec/sendgrid/helpers/eventwebhook/eventwebhook_spec.rb
262
+ - spec/sendgrid/helpers/ip_management/ip_management_spec.rb
263
+ - spec/sendgrid/helpers/settings/mail_settings_dto_spec.rb
264
+ - spec/sendgrid/helpers/settings/partner_settings_dto_spec.rb
265
+ - spec/sendgrid/helpers/settings/settings_spec.rb
266
+ - spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
267
+ - spec/sendgrid/helpers/settings/user_settings_dto_spec.rb
268
+ - spec/sendgrid/helpers/stats/email_stats_spec.rb
269
+ - spec/sendgrid/helpers/stats/metrics_spec.rb
270
+ - spec/sendgrid/helpers/stats/stats_response_spec.rb
271
+ - spec/sendgrid/sendgrid_spec.rb
272
+ - spec/sendgrid/twilio_email_spec.rb
231
273
  - spec/spec_helper.rb
274
+ - static/img/github-fork.png
275
+ - static/img/github-sign-up.png
276
+ - test/sendgrid/helpers/mail/test_attachment.rb
277
+ - test/sendgrid/helpers/mail/test_category.rb
278
+ - test/sendgrid/helpers/mail/test_email.rb
279
+ - test/sendgrid/helpers/mail/test_mail.rb
280
+ - test/sendgrid/helpers/mail/test_personalizations.rb
281
+ - test/sendgrid/permissions/test_scopes.rb
282
+ - test/sendgrid/test_sendgrid-ruby.rb
283
+ - twilio_sendgrid_logo.png
284
+ - use-cases/README.md
285
+ - use-cases/domain-authentication.md
286
+ - use-cases/email-statistics.md
287
+ - use-cases/legacy-templates.md
288
+ - use-cases/personalizations.md
289
+ - use-cases/sms.md
290
+ - use-cases/transactional-templates.md
291
+ - use-cases/twilio-email.md
292
+ - use-cases/twilio-setup.md
232
293
  homepage: http://github.com/sendgrid/sendgrid-ruby
233
294
  licenses:
234
295
  - MIT
@@ -241,23 +302,37 @@ required_ruby_version: !ruby/object:Gem::Requirement
241
302
  requirements:
242
303
  - - ">="
243
304
  - !ruby/object:Gem::Version
244
- version: '0'
305
+ version: '2.2'
245
306
  required_rubygems_version: !ruby/object:Gem::Requirement
246
307
  requirements:
247
308
  - - ">="
248
309
  - !ruby/object:Gem::Version
249
310
  version: '0'
250
311
  requirements: []
251
- rubyforge_project:
252
- rubygems_version: 2.4.8
312
+ rubygems_version: 3.3.7
253
313
  signing_key:
254
314
  specification_version: 4
255
- summary: Official SendGrid Gem
315
+ summary: Official Twilio SendGrid Gem
256
316
  test_files:
257
- - spec/lib/sendgrid/client_spec.rb
258
- - spec/lib/sendgrid/mail_spec.rb
259
- - spec/lib/sendgrid/recipient_spec.rb
260
- - spec/lib/sendgrid/template_mailer_spec.rb
261
- - spec/lib/sendgrid/template_spec.rb
262
- - spec/lib/sendgrid_spec.rb
317
+ - spec/fixtures/event_webhook.rb
318
+ - spec/rack/sendgrid_webhook_verification_spec.rb
319
+ - spec/sendgrid/helpers/eventwebhook/eventwebhook_spec.rb
320
+ - spec/sendgrid/helpers/ip_management/ip_management_spec.rb
321
+ - spec/sendgrid/helpers/settings/mail_settings_dto_spec.rb
322
+ - spec/sendgrid/helpers/settings/partner_settings_dto_spec.rb
323
+ - spec/sendgrid/helpers/settings/settings_spec.rb
324
+ - spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
325
+ - spec/sendgrid/helpers/settings/user_settings_dto_spec.rb
326
+ - spec/sendgrid/helpers/stats/email_stats_spec.rb
327
+ - spec/sendgrid/helpers/stats/metrics_spec.rb
328
+ - spec/sendgrid/helpers/stats/stats_response_spec.rb
329
+ - spec/sendgrid/sendgrid_spec.rb
330
+ - spec/sendgrid/twilio_email_spec.rb
263
331
  - spec/spec_helper.rb
332
+ - test/sendgrid/helpers/mail/test_attachment.rb
333
+ - test/sendgrid/helpers/mail/test_category.rb
334
+ - test/sendgrid/helpers/mail/test_email.rb
335
+ - test/sendgrid/helpers/mail/test_mail.rb
336
+ - test/sendgrid/helpers/mail/test_personalizations.rb
337
+ - test/sendgrid/permissions/test_scopes.rb
338
+ - test/sendgrid/test_sendgrid-ruby.rb
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --require spec_helper
data/.travis.yml DELETED
@@ -1,20 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.2
4
- - 2.0
5
- - 1.9.3
6
- notifications:
7
- hipchat:
8
- rooms:
9
- secure: gYBEwOGBTxHE2nrxsHQqp2UdjRtCX04wVLYEimeT9RG/0LClS4nzJF7DaXLWlAwgLPmk+KV2+nXuLO5oausBr9ODmWhho8G0F90RPR47NupcvT1RM+I2ZbxSjHCUICL22mdnZd8ye/mrk/YtFWYmgmH7ILRK3BuYovXFoKoRnLg=
10
- template:
11
- - '<a href="https://travis-ci.org/%{repository}/builds/%{build_id}">%{repository}
12
- Build %{build_number}</a> on branch <i>%{branch}</i> by %{author}: <strong>%{message}</strong>
13
- <a href="https://github.com/sendgrid/docs/commits/%{commit}">View on GitHub</a>'
14
- format: html
15
- notify: false
16
- before_script:
17
- - bundle install
18
- script:
19
- - rubocop --fail-level=E
20
- - rake
data/FETCH_HEAD DELETED
File without changes
data/Guardfile DELETED
@@ -1,10 +0,0 @@
1
- notification :gntp
2
- guard :rspec, cmd: 'rspec' do
3
- watch(%r{^spec/.+_spec\.rb$})
4
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
5
- watch('spec/spec_helper.rb') { 'spec' }
6
- end
7
-
8
- guard :rubocop, all_on_start: false do
9
- watch(%r{^lib/(.+)\.rb$})
10
- end
data/LICENSE.txt DELETED
@@ -1,22 +0,0 @@
1
- Copyright (c) 2014 SendGrid Inc.
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/example.rb DELETED
@@ -1,41 +0,0 @@
1
- # test using: ruby example.rb
2
- # using ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
3
- # attachment is sent but only a corrupted 1k file
4
-
5
-
6
- require_relative "lib/sendgrid-ruby.rb"
7
-
8
- require 'dotenv'
9
- Dotenv.load
10
-
11
- # sendgrid_username = ENV['SENDGRID_USERNAME']
12
- # sendgrid_password = ENV['SENDGRID_PASSWORD']
13
- sendgrid_apikey = ENV['SENDGRID_APIKEY']
14
-
15
- # client = SendGrid::Client.new(api_user: sendgrid_username, api_key: sendgrid_password)
16
-
17
- client = SendGrid::Client.new do |c|
18
- # c.api_user = sendgrid_username
19
- c.api_key = sendgrid_apikey
20
- end
21
-
22
- mail = SendGrid::Mail.new do |m|
23
- m.to = 'to@example.com'
24
- m.to_name = 'John Doe'
25
- m.from = 'from@example.com'
26
- m.from_name = 'Jane Doe'
27
- m.cc = 'cc@example.com'
28
- m.cc_name = 'John Doe CC'
29
- m.bcc = 'bcc@examlpe.com'
30
- m.bcc_name = 'Jane Doe BCC'
31
- m.subject = 'Hello world!'
32
- m.text = 'I heard you like the beach.'
33
- m.html = 'I heard you like the beach <div><img src="cid:beach"></div>'
34
- end
35
- mail.add_content('/tmp/beach.jpg', 'beach')
36
- mail.add_attachment('/tmp/report.pdf', 'report.pdf')
37
- result = client.send(mail)
38
- puts result.code
39
- puts result.body
40
-
41
- # puts client.send(SendGrid::Mail.new(to: 'elmer.thomas@sendgrid.com', from: 'elmer@thinkingserious.com', subject: 'Hello world!', text: 'Hi there, testing from Ruby!', html: '<b>Hi there, testing from Ruby!</b>'))
@@ -1,62 +0,0 @@
1
- require 'faraday'
2
-
3
- module SendGrid
4
- class Client
5
- attr_accessor :api_user, :api_key, :protocol, :host, :port, :url, :endpoint,
6
- :user_agent, :template
7
- attr_writer :adapter, :conn, :raise_exceptions
8
-
9
- def initialize(params = {})
10
- self.api_user = params.fetch(:api_user, nil)
11
- self.api_key = params.fetch(:api_key, nil)
12
- self.protocol = params.fetch(:protocol, 'https')
13
- self.host = params.fetch(:host, 'api.sendgrid.com')
14
- self.port = params.fetch(:port, nil)
15
- self.url = params.fetch(:url, protocol + '://' + host + (port ? ":#{port}" : ''))
16
- self.endpoint = params.fetch(:endpoint, '/api/mail.send.json')
17
- self.adapter = params.fetch(:adapter, adapter)
18
- self.conn = params.fetch(:conn, conn)
19
- self.user_agent = params.fetch(:user_agent, "sendgrid/#{SendGrid::VERSION};ruby")
20
- self.raise_exceptions = params.fetch(:raise_exceptions, true)
21
- yield self if block_given?
22
- end
23
-
24
- def send(mail)
25
- res = conn.post do |req|
26
- payload = mail.to_h
27
- req.url(endpoint)
28
-
29
- # Check if using username + password or API key
30
- if api_user
31
- # Username + password
32
- payload = payload.merge(api_user: api_user, api_key: api_key)
33
- else
34
- # API key
35
- req.headers['Authorization'] = "Bearer #{api_key}"
36
- end
37
-
38
- req.body = payload
39
- end
40
-
41
- fail SendGrid::Exception, res.body if raise_exceptions? && res.status != 200
42
-
43
- SendGrid::Response.new(code: res.status, headers: res.headers, body: res.body)
44
- end
45
-
46
- def conn
47
- @conn ||= Faraday.new(url: url) do |conn|
48
- conn.request :multipart
49
- conn.request :url_encoded
50
- conn.adapter adapter
51
- end
52
- end
53
-
54
- def adapter
55
- @adapter ||= Faraday.default_adapter
56
- end
57
-
58
- def raise_exceptions?
59
- @raise_exceptions
60
- end
61
- end
62
- end
@@ -1,7 +0,0 @@
1
- module SendGrid
2
- class Exception < StandardError
3
- def initialize(message)
4
- super(message)
5
- end
6
- end
7
- end