sendgrid_webapi 0.0.2 → 0.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.
Files changed (80) hide show
  1. data/.rbenv-version +1 -0
  2. data/README.rdoc +76 -77
  3. data/lib/version.rb +1 -1
  4. data/lib/web_api/blocks.rb +5 -0
  5. data/lib/web_api/bounces.rb +5 -0
  6. data/lib/webapi_client.rb +1 -1
  7. data/sendgrid_webapi.gemspec +1 -1
  8. data/spec/cassettes/client/_modules/_block/should_get_block_emails.yml +29 -41
  9. data/spec/cassettes/client/_modules/_block/should_get_totals_blocks.yml +36 -0
  10. data/spec/cassettes/client/_modules/_block/should_try_delete_not_existing_block_email.yml +29 -42
  11. data/spec/cassettes/client/_modules/_bounce/should_get_bounce_emails.yml +27 -31
  12. data/spec/cassettes/client/_modules/_bounce/should_get_totals_bounces.yml +36 -0
  13. data/spec/cassettes/client/_modules/_bounce/should_try_delete_not_existing_bounce_email.yml +27 -32
  14. data/spec/cassettes/client/_modules/_event_notification/should_delete_event_notification_url.yml +38 -40
  15. data/spec/cassettes/client/_modules/_event_notification/should_get_event_notification_url.yml +38 -40
  16. data/spec/cassettes/client/_modules/_event_notification/should_set_event_notification_url.yml +38 -40
  17. data/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails.yml +27 -31
  18. data/spec/cassettes/client/_modules/_invalid_email/should_try_delete_not_existing_invalid_emails.yml +27 -32
  19. data/spec/cassettes/client/_modules/_parse_email/should_delete_parse_email.yml +73 -76
  20. data/spec/cassettes/client/_modules/_parse_email/should_get_parse_email.yml +38 -41
  21. data/spec/cassettes/client/_modules/_parse_email/should_set_parse_email.yml +38 -40
  22. data/spec/cassettes/client/_modules/_profile/should_get_profile.yml +39 -43
  23. data/spec/cassettes/client/_modules/_profile/should_set_first_name.yml +109 -117
  24. data/spec/cassettes/client/_modules/_spam/should_get_spam_emails.yml +27 -31
  25. data/spec/cassettes/client/_modules/_spam/should_try_delete_not_existing_spam_emails.yml +27 -32
  26. data/spec/cassettes/client/_modules/_unsubscribe/should_add_unsubscribe_emails.yml +27 -31
  27. data/spec/cassettes/client/_modules/_unsubscribe/should_delete_unsubscribe_email.yml +27 -31
  28. data/spec/cassettes/client/_modules/_unsubscribe/should_get_unsubscribe_emails.yml +27 -32
  29. data/spec/cassettes/client/_modules/_unsubscribe/should_try_delete_not_existing_unsubscribe_emails.yml +27 -32
  30. data/spec/cassettes/helper/_create_sub_user_account/should_create_sub_user_account.yml +248 -255
  31. data/spec/cassettes/helper/_run_sendgrid_query/should_raise_with_unsucessfull_request.yml +39 -38
  32. data/spec/cassettes/helper/_run_sendgrid_query/should_run_sendgrid_request.yml +38 -40
  33. data/spec/cassettes/sub_user/_apps/should_activate_app.yml +38 -40
  34. data/spec/cassettes/sub_user/_apps/should_deactivate_app.yml +38 -40
  35. data/spec/cassettes/sub_user/_apps/should_get_current_setting_from_one_app.yml +38 -41
  36. data/spec/cassettes/sub_user/_apps/should_return_available_apps.yml +63 -55
  37. data/spec/cassettes/sub_user/_apps/should_set_current_app.yml +73 -72
  38. data/spec/cassettes/sub_user/_authentication/should_auth_a_sub_user.yml +38 -40
  39. data/spec/cassettes/sub_user/_authentication/should_return_error_with_a_bad_sub_user.yml +38 -40
  40. data/spec/cassettes/sub_user/_bounces/should_returns_bounce_emails.yml +38 -39
  41. data/spec/cassettes/sub_user/_bounces/should_tries_to_delete_unexisting_bounce_emails.yml +38 -40
  42. data/spec/cassettes/sub_user/_event_notification/should_add_event_notification_url.yml +38 -40
  43. data/spec/cassettes/sub_user/_event_notification/should_delete_event_notification_url.yml +38 -40
  44. data/spec/cassettes/sub_user/_event_notification/should_get_event_notification_url.yml +38 -40
  45. data/spec/cassettes/sub_user/_invalid_emails/should_return_invalid_emails.yml +38 -39
  46. data/spec/cassettes/sub_user/_invalid_emails/should_tries_to_delete_unexisting_invalid_mail.yml +38 -40
  47. data/spec/cassettes/sub_user/_ip_management/should_return_all_ips_available.yml +38 -40
  48. data/spec/cassettes/sub_user/_ip_management/should_show_ip_subuser.yml +38 -40
  49. data/spec/cassettes/sub_user/_limits/should_decrements_credits_for_a_sub_user.yml +73 -77
  50. data/spec/cassettes/sub_user/_limits/should_delete_all_limits_for_a_sub_user.yml +73 -76
  51. data/spec/cassettes/sub_user/_limits/should_increments_credits_for_a_sub_user.yml +73 -77
  52. data/spec/cassettes/sub_user/_limits/should_list_the_limits_for_a_sub_user.yml +38 -40
  53. data/spec/cassettes/sub_user/_limits/should_reset_all_limits_for_a_sub_user.yml +73 -77
  54. data/spec/cassettes/sub_user/_limits/should_returns_limits_for_a_sub_user.yml +38 -40
  55. data/spec/cassettes/sub_user/_limits/should_set_total_credits.yml +38 -40
  56. data/spec/cassettes/sub_user/_management/should_add_new_subuser.yml +38 -40
  57. data/spec/cassettes/sub_user/_management/should_disable_sub_user_for_send_email.yml +38 -40
  58. data/spec/cassettes/sub_user/_management/should_enable_sub_user_for_access_to_website.yml +38 -40
  59. data/spec/cassettes/sub_user/_management/should_enable_sub_user_for_send_email.yml +38 -40
  60. data/spec/cassettes/sub_user/_management/should_update_sub_user.yml +38 -40
  61. data/spec/cassettes/sub_user/_monitor_records/should_add_existing_sub_user_to_monitor_record.yml +72 -77
  62. data/spec/cassettes/sub_user/_monitor_records/should_create_a_new_monitor_record.yml +72 -77
  63. data/spec/cassettes/sub_user/_monitor_records/should_delete_a_monitor_record.yml +71 -74
  64. data/spec/cassettes/sub_user/_monitor_records/should_edit_a_monitor_record.yml +71 -76
  65. data/spec/cassettes/sub_user/_monitor_records/should_remove_existing_sub_user_from_monitor_record.yml +72 -77
  66. data/spec/cassettes/sub_user/_parse_email/should_delete_parse_email.yml +73 -76
  67. data/spec/cassettes/sub_user/_parse_email/should_get_parse_email.yml +38 -41
  68. data/spec/cassettes/sub_user/_parse_email/should_set_parse_email.yml +38 -40
  69. data/spec/cassettes/sub_user/_spam/should_return_spam_mails.yml +38 -39
  70. data/spec/cassettes/sub_user/_spam/should_tries_to_delete_unexisting_spam_mail.yml +38 -40
  71. data/spec/cassettes/sub_user/_unsubscribes/should_add_bounce_email.yml +38 -40
  72. data/spec/cassettes/sub_user/_unsubscribes/should_delete_existing_bounce_email.yml +38 -40
  73. data/spec/cassettes/sub_user/_unsubscribes/should_delete_unexisting_bounce_email.yml +38 -40
  74. data/spec/cassettes/sub_user/_unsubscribes/should_returns_bounce_emails.yml +38 -40
  75. data/spec/client_spec.rb +5 -2
  76. data/spec/helper_spec.rb +5 -5
  77. data/spec/sub_user_spec.rb +62 -67
  78. data/test.rb +5 -0
  79. metadata +10 -6
  80. data/spec/cassettes/sub_user/_management/should_get_all_subusers.yml +0 -54
data/.rbenv-version ADDED
@@ -0,0 +1 @@
1
+ 1.9.3-p194
data/README.rdoc CHANGED
@@ -1,4 +1,5 @@
1
- = SendGrid WEB API gem for Rails 3 {<img src="https://secure.travis-ci.org/kylejginavan/sendgrid_webapi.png"/>}[http://travis-ci.org/kylejginavan/sendgrid_webapi]
1
+ = SendGrid WEB API gem for Rails 3
2
+ {<img src="https://secure.travis-ci.org/kylejginavan/sendgrid_webapi.png"/>}[http://travis-ci.org/kylejginavan/sendgrid_webapi] {<img src="https://badge.fury.io/rb/sendgrid_webapi.png" alt="Gem Version" />}[http://badge.fury.io/rb/sendgrid_webapi] {<img src="https://codeclimate.com/github/kylejginavan/sendgrid_webapi.png" />}[https://codeclimate.com/github/kylejginavan/sendgrid_webapi]
2
3
 
3
4
  SendGrid WEB API gem allow you to retrieve information such as statistics, bounces, spam reports, unsubscribes, send email and other information.
4
5
 
@@ -6,7 +7,13 @@ SendGrid WEB API gem allow you to retrieve information such as statistics, bounc
6
7
 
7
8
  In your Gemfile:
8
9
 
9
- gem 'sendgrid_webapi'
10
+ for sendgrid v3 support
11
+
12
+ gem 'sendgrid_webapi', '0.0.3'
13
+
14
+ for sendgrid v2 support
15
+
16
+ gem 'sendgrid_webapi', '0.0.2'
10
17
 
11
18
  == Usage examples
12
19
 
@@ -23,7 +30,9 @@ This module allows you to retrieve and delete email addresses that have bounced
23
30
 
24
31
  client.bounces.delete(:email => "email@example.com", :foor => "bar")
25
32
 
26
- * options are available here: http://docs.sendgrid.com/documentation/api/web-api/webapibounces
33
+ client.blocks.count
34
+
35
+ * options are available here: http://sendgrid.com/docs/API_Reference/Web_API/bounces.html
27
36
 
28
37
  === Blocks
29
38
  This module allows you to retrieve and delete email addresses that were blocked by their ISP. These emails are not suppressed and are just for information.
@@ -32,7 +41,9 @@ This module allows you to retrieve and delete email addresses that were blocked
32
41
 
33
42
  client.blocks.delete(:email => "email@example.com", :foor => "bar")
34
43
 
35
- * options are available here: http://docs.sendgrid.com/documentation/api/web-api/webapiblocks
44
+ client.blocks.count
45
+
46
+ * options are available here: http://sendgrid.com/docs/API_Reference/Web_API/blocks.html
36
47
 
37
48
  === Invalid Email
38
49
  This module allows you to retrieve and delete email addresses that you've sent to that are invalid email addresses.
@@ -41,7 +52,7 @@ This module allows you to retrieve and delete email addresses that you've sent t
41
52
 
42
53
  client.invalid_emails.delete(:email => "email@example.com", :foor => "bar")
43
54
 
44
- * options are available here: http://docs.sendgrid.com/documentation/api/web-api/webapiinvalidemails
55
+ * options are available here: http://sendgrid.com/docs/API_Reference/Web_API/invalid_emails.html
45
56
 
46
57
  === Spam Report
47
58
  This module allows you to retrieve and delete email addresses that have marked your emails as SPAM.
@@ -50,7 +61,7 @@ This module allows you to retrieve and delete email addresses that have marked y
50
61
 
51
62
  client.spam.delete(:email => "email@example.com", :foor => "bar")
52
63
 
53
- * options are available here: http://docs.sendgrid.com/documentation/api/web-api/webapispamreports
64
+ * options are available here: http://sendgrid.com/docs/API_Reference/Web_API/spam_reports.html
54
65
 
55
66
  === Unsubscribes
56
67
  This module allows you to add, retrieve and delete email addresses that were unsubscribed from your emails.
@@ -61,18 +72,18 @@ This module allows you to add, retrieve and delete email addresses that were uns
61
72
 
62
73
  client.unsubscribes.delete(:email => "email@example.com", :foor => "bar")
63
74
 
64
- * options are available here: http://docs.sendgrid.com/documentation/api/web-api/webapiunsubscribes
75
+ * options are available here: http://sendgrid.com/docs/API_Reference/Web_API/unsubscribes.html
65
76
 
66
77
  === Parse Email
67
78
  This module allows you to add, edit, or delete your email parse settings.
68
79
 
69
- client.parse_emails.add(:hostname => "www.example.com", :url => "www.domain.com/parse.php", :spam_check => 1)
80
+ client.parse_email.add(:hostname => "www.example.com", :url => "www.domain.com/parse.php", :spam_check => 1)
70
81
 
71
- client.parse_emails.get(options)
82
+ client.parse_email.get(options)
72
83
 
73
- client.parse_emails.delete(:hostname => "www.example.com")
84
+ client.parse_email.delete(:hostname => "www.example.com")
74
85
 
75
- * options are available here: http://docs.sendgrid.com/documentation/api/web-api/webapiparse
86
+ * options are available here: http://sendgrid.com/docs/API_Reference/Web_API/parse_settings.html
76
87
 
77
88
  === Event Notification URL
78
89
  This module allows you to add, edit, or delete an event notification URL for your account.
@@ -83,7 +94,7 @@ This module allows you to add, edit, or delete an event notification URL for you
83
94
 
84
95
  client.event_notification.delete(options)
85
96
 
86
- * options are available here: http://docs.sendgrid.com/documentation/api/web-api/event-notification-url
97
+ * options are available here: http://sendgrid.com/docs/API_Reference/Webhooks/event.html
87
98
 
88
99
 
89
100
  === Stats
@@ -91,30 +102,30 @@ This module allows you to retrieve statistical data on a range of metrics includ
91
102
 
92
103
  client.stats.get(options)
93
104
 
94
- * options are available here: http://docs.sendgrid.com/documentation/api/web-api/event-notification-url
105
+ * options are available here: http://sendgrid.com/docs/API_Reference/Web_API/Statistics/index.html
95
106
 
96
107
  === Profile
97
108
  This module allows you to retrieve and update your profile information such as credentials and email address.
98
109
 
99
110
  client.profile.get(options)
100
-
111
+
101
112
  client.profile.set(options)
102
-
113
+
103
114
  client.profile.set_password(:password => "foo", :confirm_password => "foo")
104
115
 
105
116
  client.profile.set_username(:username => "yournewusername@domain.com")
106
-
117
+
107
118
  client.profile.set_email(:email => "yournewusername@domain.com")
108
119
 
109
- * options are available here: http://docs.sendgrid.com/documentation/api/web-api/webapiprofile
120
+ * options are available here: http://sendgrid.com/docs/API_Reference/Web_API/profile.html
110
121
 
111
122
 
112
123
  === Mail
113
124
  This module allows you to send email.
114
-
125
+
115
126
  client.mail.send(:to => "test@test.com", :subject => "test", :text => "some body", :from => "test@example.com")
116
-
117
- * options are available here: http://docs.sendgrid.com/documentation/api/web-api/mail/
127
+
128
+ * options are available here: http://sendgrid.com/docs/Code_Examples/ruby.html
118
129
 
119
130
  == SubUser
120
131
 
@@ -128,7 +139,7 @@ This module allows you to send email.
128
139
  == Modules
129
140
 
130
141
  === Management SubUsers
131
- Retrieve/Create/Enable/Disable your subusers. Change a subuser email address and username.
142
+ Retrieve/Create/Enable/Disable your subusers. Change a subuser email address and username. Docs can be found here: http://sendgrid.com/docs/API_Reference/Customer_Subuser_API/index.html
132
143
 
133
144
  Create a sub_user
134
145
 
@@ -157,14 +168,14 @@ Disable a subuser to login to the SendGrid.com website
157
168
  Allows you to update your subusers profile information
158
169
 
159
170
  client.sub_user.management.update(:user => "sub_user", :first_name => "change_named")
160
-
171
+
161
172
  client.sub_user.management.update_password(:user => "sub_user", :password => "somepassword", :confirm_password => "somepassword")
162
173
 
163
174
  client.sub_user.management.update_username(:user => "sub_user", :username => "newusername")
164
-
175
+
165
176
  client.sub_user.management.update_email(:user => "sub_user", :email => "newemail")
166
-
167
- * options are available here: http://docs.sendgrid.com/documentation/api/customer-subuser-api/customer-api/subusers/
177
+
178
+ * options are available here: http://sendgrid.com/docs/API_Reference/Customer_Subuser_API/subusers.html
168
179
 
169
180
  === Bounces
170
181
  This module allows you to manage bounce records of your subusers.
@@ -173,7 +184,7 @@ This module allows you to manage bounce records of your subusers.
173
184
 
174
185
  client.sub_user.bounces.delete(:user => "sub_user", :email => "email@example.com")
175
186
 
176
- * options are available here: http://docs.sendgrid.com/documentation/api/customer-subuser-api/customer-subuser-api-v1/email-list-management/subuser-bounces/
187
+ * options are available here: http://sendgrid.com/docs/API_Reference/Customer_Subuser_API/subuser_bounces.html
177
188
 
178
189
  === Invalid Email
179
190
  This module allows you to manage invalid emails of your subusers.
@@ -182,7 +193,7 @@ This module allows you to manage invalid emails of your subusers.
182
193
 
183
194
  client.sub_user.invalid_emails.delete(:user => "sub_user", :email => "email@example.com")
184
195
 
185
- * options are available here: http://docs.sendgrid.com/documentation/api/customer-subuser-api/customer-api/subuser-invalid-emails/
196
+ * options are available here: http://sendgrid.com/docs/API_Reference/Customer_Subuser_API/invalid_emails.html
186
197
 
187
198
  === Spam Report
188
199
  This module allows you to manage spam reports of your subusers.
@@ -191,7 +202,7 @@ This module allows you to manage spam reports of your subusers.
191
202
 
192
203
  client.sub_user.spam.delete(:user => "sub_user", :email => "email@example.com")
193
204
 
194
- * options are available here: http://docs.sendgrid.com/documentation/api/customer-subuser-api/customer-subuser-api-v1/email-list-management/subuser-spam-reports/
205
+ * options are available here: http://sendgrid.com/docs/API_Reference/Customer_Subuser_API/subuser_spam_reports.html
195
206
 
196
207
  === Unsubscribes
197
208
  This module allows you to manage unsubscribes of your subusers.
@@ -202,18 +213,18 @@ This module allows you to manage unsubscribes of your subusers.
202
213
 
203
214
  client.sub_user.unsubscribes.delete(:user => "sub_user", :email => "email@example.com")
204
215
 
205
- * options are available here: http://docs.sendgrid.com/documentation/api/customer-subuser-api/customer-subuser-api-v1/email-list-management/subusers-unsubscribes/
216
+ * options are available here: http://sendgrid.com/docs/API_Reference/Customer_Subuser_API/subuser_unsubscribes.html
206
217
 
207
218
  === Parse Email
208
219
  This module allows you to setup subusers parse settings
209
220
 
210
- client.sub_user.parse_emails.add(:user => "sub_user", :hostname => "www.example.com", :url => "www.domain.com/parse.php", :spam_check => 1)
221
+ client.sub_user.parse_email.add(:user => "sub_user", :hostname => "www.example.com", :url => "www.domain.com/parse.php", :spam_check => 1)
211
222
 
212
- client.sub_user.parse_emails.get(:user => "sub_user")
223
+ client.sub_user.parse_email.get(:user => "sub_user")
213
224
 
214
- client.sub_user.parse_emails.delete(:user => "sub_user", :hostname => "www.example.com")
225
+ client.sub_user.parse_email.delete(:user => "sub_user", :hostname => "www.example.com")
215
226
 
216
- * options are available here: http://docs.sendgrid.com/documentation/api/customer-subuser-api/customer-api/parse-settings/
227
+ * options are available here: http://sendgrid.com/docs/API_Reference/Customer_Subuser_API/parse_settings.html
217
228
 
218
229
  === Event Notification URL
219
230
  This module allows you to manage subusers event notification url.
@@ -224,7 +235,7 @@ This module allows you to manage subusers event notification url.
224
235
 
225
236
  client.sub_user.event_notification.delete(:user => "sub_user", :url => "http://www.yourposturlhere.com")
226
237
 
227
- * options are available here: http://docs.sendgrid.com/documentation/api/customer-subuser-api/customer-api/event-notification-url/
238
+ * options are available here: http://sendgrid.com/docs/API_Reference/Customer_Subuser_API/event_notification_url.html
228
239
 
229
240
 
230
241
  === Stats
@@ -232,38 +243,38 @@ This module allows you to see statistics regarding your subusers.
232
243
 
233
244
  client.sub_user.stats.get(:user => "sub_user")
234
245
 
235
- * options are available here: http://docs.sendgrid.com/documentation/api/customer-subuser-api/customer-api/statistics/
246
+ * options are available here: http://sendgrid.com/docs/API_Reference/Customer_Subuser_API/statistics.html
236
247
 
237
248
  === Limits
238
249
  This module allows you to manage the rate of emails your subusers are able to send
239
250
 
240
251
  client.sub_user.limits.get(:user => "sub_user")
241
-
252
+
242
253
  client.sub_user.limits.set_credits(:user => "sub_user", :credits=> "200", :period=> "daily")
243
-
254
+
244
255
  client.sub_user.limits.reset(:user => "sub_user", :credits=> "400", :period=> "daily")
245
-
256
+
246
257
  client.sub_user.limits.increment_credits(:user => "sub_user", :credits=> "400")
247
-
258
+
248
259
  client.sub_user.limits.decrement_credits(:user => "sub_user", :credits=> "400")
249
260
 
250
261
  To remove all limits from your sub_user
251
262
 
252
263
  client.sub_user.limits.delete(:user => "sub_user")
253
264
 
254
- * options are available here: http://docs.sendgrid.com/documentation/api/customer-subuser-api/customer-api/account-limits/
265
+ * options are available here: http://sendgrid.com/docs/API_Reference/Customer_Subuser_API/account_limits.html
255
266
 
256
267
 
257
268
  === Monitor Records
258
269
  Make sure your subusers arent sending out spam by getting a sample of their outgoing messages
259
270
 
260
271
  client.sub_user.monitor_records.create(:name => "testmonitor", :frequency => 10000, :email => "test@test.com")
261
-
272
+
262
273
  client.sub_user.monitor_records.edit(:name => "testmonitor", :new_frequency => 10)
263
-
274
+
264
275
  client.sub_user.monitor_records.add_user(:user => "sub_user", :name => "testmonitor")
265
-
266
- * options are available here: http://docs.sendgrid.com/documentation/api/customer-subuser-api/customer-api/monitor-records/
276
+
277
+ * options are available here: http://sendgrid.com/docs/API_Reference/Customer_Subuser_API/monitor_records.html
267
278
 
268
279
  === IP Management
269
280
  List all IP addresses you have under your account and retrieve details about them
@@ -273,14 +284,14 @@ To obtain a complete list of all IP's and which are free, taken or available. Se
273
284
  client.sub_user.ip_management.get(:user => "sub_user")
274
285
 
275
286
  To get the ip that is using your sub_user
276
-
287
+
277
288
  client.sub_user.ip_management.usage_ip(:user => "sub_user")
278
-
279
- To assign one ip to your sub_user
280
-
289
+
290
+ To assign one ip to your sub_user
291
+
281
292
  client.sub_user.ip_management.assign_ip(:user => "sub_user", :ip => ["IP1", "IP2"])
282
293
 
283
- * options are available here: http://docs.sendgrid.com/documentation/api/customer-subuser-api/customer-api/ip-management/
294
+ * options are available here: http://sendgrid.com/docs/API_Reference/Customer_Subuser_API/ip_management.html
284
295
 
285
296
  === WhiteLabel
286
297
  Manage whitelabel settings for your subusers
@@ -294,51 +305,39 @@ To set a subusers whitelabel domain
294
305
  client.sub_user.whitelabel.add(:user => "sub_user", :mail_domain => "email.sendgrid.com")
295
306
 
296
307
 
297
- * options are available here: http://docs.sendgrid.com/documentation/api/customer-subuser-api/customer-api/whitelabel/
298
-
308
+ * options are available here: http://sendgrid.com/docs/API_Reference/Customer_Subuser_API/whitelabel.html
309
+
299
310
 
300
311
  === IFrame
301
312
  Allow users to manage your subusers via iframe using our site
302
313
 
303
314
  client.sub_user.iframe.get(:user => "sub_user")
304
315
 
305
- * options are available here: http://docs.sendgrid.com/documentation/api/customer-subuser-api/customer-api/automatic-login/
306
-
307
-
308
- === Parse Email
309
- This module allows you to setup subusers parse settings.
310
-
311
- client.sub_user.parse_emails.add(:user => "sub_user", :hostname => "www.example.com", :url => "www.domain.com/parse.php", :spam_check => 1)
312
-
313
- client.sub_user.parse_emails.get(:user => "sub_user")
314
-
315
- client.sub_user.parse_emails.delete(:user => "sub_user", :hostname => "www.example.com")
316
-
317
- * options are available here: http://docs.sendgrid.com/documentation/api/customer-subuser-api/customer-api/parse-settings/
316
+ * options are available here: http://sendgrid.com/docs/API_Reference/Customer_Subuser_API/automatic_login.html
318
317
 
319
318
 
320
319
  === Authentication
321
320
  This module allows you to check subusers password to see if its valid.
322
321
 
323
322
  client.sub_user.auth.login(:user => "sub_user", :password => "somepass").
324
-
325
- * options are available here: http://docs.sendgrid.com/documentation/api/customer-subuser-api/customer-api/authenticate-a-subuser/
323
+
324
+ * options are available here: http://sendgrid.com/docs/API_Reference/Customer_Subuser_API/authenticate_a_subuser.html
326
325
 
327
326
 
328
327
  === Apps
329
328
  This module allows you to setup subusers app settings.
330
329
 
331
330
  client.sub_user.apps.list(:user => "sub_user")
332
-
331
+
333
332
  client.sub_user.apps.activate(:user => "sub_user", :name => "opentrack")
334
333
 
335
334
  client.sub_user.apps.deactivate(:user => "sub_user", :name => "opentrack")
336
-
335
+
337
336
  client.sub_user.apps.current_settings(:user => "sub_user", :name => "eventnotify")
338
-
339
- client.sub_user.apps.customize(:user => "sub_user", :name => "eventnotify", :processed => "0", :dropped => "1", :deferred => "1", :delivered => "0", :bounce => "1", :click => "1", :open => "1", :unsubscribe => "1", :spamreport => "1", :url => "http://someurl.com/listener"))
340
-
341
- * options are available here: http://docs.sendgrid.com/documentation/api/customer-subuser-api/customer-api/filter-apps/
337
+
338
+ client.sub_user.apps.customize(:user => "sub_user", :name => "eventnotify", :processed => "0", :dropped => "1", :deferred => "1", :delivered => "0", :bounce => "1", :click => "1", :open => "1", :unsubscribe => "1", :spamreport => "1", :url => "http://someurl.com/listener"))
339
+
340
+ * options are available here: http://sendgrid.com/docs/API_Reference/Customer_Subuser_API/apps.html
342
341
 
343
342
 
344
343
  == Helper
@@ -351,18 +350,18 @@ define the data
351
350
  user_hash = {:website => "someurl.com", :password => "somepass", :confirm_password => "somepass",
352
351
  :first_name => "home", :last_name => "simpson", :address => "555 anystreet", :city => "any city",
353
352
  :state => "CA" , :zip => "91234", :email => "email@email.com", :country => "US", :phone => "555-555"}
354
-
353
+
355
354
  apps = { :opentrack => {:name => "eventnotify", :processed => "0", :dropped => "1", :deferred => "1",
356
- :delivered => "0", :bounce => "1", :click => "1", :open => "1", :unsubscribe => "1", :spamreport => "1",
355
+ :delivered => "0", :bounce => "1", :click => "1", :open => "1", :unsubscribe => "1", :spamreport => "1",
357
356
  :url => "https://agencieshq.com/sendgrid/v1/listener"},
358
357
  :clicktrack => {:enable_text => "1"},
359
358
  :opentrack => {}
360
359
  }
361
360
 
362
361
  users = {"username" => {:account => user_hash, :applications => apps, :assigned_ips => ["IP"]}}
363
-
362
+
364
363
  call the helper
365
-
364
+
366
365
  create_sub_user_account("sendgrid user", "sendgrid pass", users)
367
366
 
368
367
  === Run SendGrid Query
@@ -386,4 +385,4 @@ The API call was unsuccessful. The gem will return ApiException raise.
386
385
  == CONTRIBUTORS:
387
386
 
388
387
  * Kyle J. Ginavan.
389
- * Mauro Torres - http://github.com/chebyte
388
+ * Mauro Torres - http://github.com/chebyte
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module SendGridWebApi
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -9,5 +9,10 @@ module SendGridWebApi::Modules
9
9
  block_delete_url = "blocks.delete.json"
10
10
  query_api(block_delete_url, options)
11
11
  end
12
+
13
+ def count options = {}
14
+ block_count_url = "blocks.count.json"
15
+ query_api(block_count_url, options)
16
+ end
12
17
  end
13
18
  end
@@ -9,5 +9,10 @@ module SendGridWebApi::Modules
9
9
  bounce_delete_url = "bounces.delete.json"
10
10
  query_api(bounce_delete_url, options)
11
11
  end
12
+
13
+ def count options = {}
14
+ bounces_count_url = "bounces.count.json"
15
+ query_api(bounces_count_url, options)
16
+ end
12
17
  end
13
18
  end
data/lib/webapi_client.rb CHANGED
@@ -5,7 +5,7 @@ module SendGridWebApi
5
5
  include SendGridWebApi::Modules
6
6
 
7
7
  def base_url
8
- "https://sendgrid.com/api/"
8
+ "https://api.sendgrid.com/api/"
9
9
  end
10
10
 
11
11
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.require_paths = ["lib"]
21
21
  s.add_development_dependency "rspec", "~> 2.10.0"
22
22
  s.add_development_dependency "webmock", "~> 1.8.7"
23
- s.add_development_dependency "vcr", "~> 2.1.1"
23
+ s.add_development_dependency "vcr", "~> 2.8.0"
24
24
  s.add_dependency "faraday", "~> 0.8.0"
25
25
  s.add_dependency "json", "~> 1.8.0"
26
26
 
@@ -1,48 +1,36 @@
1
- ---
2
- http_interactions:
3
- - request:
1
+ ---
2
+ http_interactions:
3
+ - request:
4
4
  method: get
5
- uri: https://sendgrid.com/api/blocks.get.json?api_key=pass&api_user=user
6
- body:
5
+ uri: https://api.sendgrid.com/api/blocks.get.json?api_key=pass&api_user=user
6
+ body:
7
7
  encoding: US-ASCII
8
- string: ""
9
- headers:
10
- Accept-Encoding:
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.8.9
12
+ Accept-Encoding:
11
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
- Accept:
13
- - "*/*"
14
- User-Agent:
15
- - Ruby
16
- response:
17
- status:
14
+ Accept:
15
+ - '*/*'
16
+ response:
17
+ status:
18
18
  code: 200
19
19
  message: OK
20
- headers:
21
- Server:
22
- - nginx/0.7.65
23
- Date:
24
- - Mon, 02 Jul 2012 14:42:51 GMT
25
- Content-Type:
26
- - application/json
27
- Connection:
20
+ headers:
21
+ Server:
22
+ - nginx/1.4.2
23
+ Date:
24
+ - Fri, 17 Jan 2014 01:37:37 GMT
25
+ Content-Type:
26
+ - text/html
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
28
30
  - keep-alive
29
- X-Powered-By:
30
- - PHP/5.3.2-1ubuntu4.14
31
- Cache-Control:
32
- - private
33
- Set-Cookie:
34
- - sendgrid_frontend=f0e7344786a2d782f7bab47e30ecf283:de5a5348f999469fb4a7e2216d67fa03459c9f52; expires=Wed, 01-Aug-2012 14:42:27 GMT; path=/; httponly
35
- Content-Encoding:
36
- - gzip
37
- Vary:
38
- - Accept-Encoding
39
- Content-Length:
40
- - "28"
41
- body:
42
- encoding: ASCII-8BIT
43
- string: !binary |
44
- H4sIAAAAAAAAA4qOBQAAAP//AwApu0wNAgAAAA==
45
-
31
+ body:
32
+ encoding: UTF-8
33
+ string: '[]'
46
34
  http_version:
47
- recorded_at: Mon, 02 Jul 2012 14:42:51 GMT
48
- recorded_with: VCR 2.1.1
35
+ recorded_at: Fri, 17 Jan 2014 01:37:37 GMT
36
+ recorded_with: VCR 2.8.0