sendgrid-ruby 1.1.6 → 6.6.2

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 (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
@@ -0,0 +1,198 @@
1
+ require 'sendgrid-ruby'
2
+
3
+ sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
4
+
5
+ ##################################################
6
+ # Retrieve all blocks #
7
+ # GET /suppression/blocks #
8
+
9
+ params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
10
+ response = sg.client.suppression.blocks.get(query_params: params)
11
+ puts response.status_code
12
+ puts response.body
13
+ puts response.headers
14
+
15
+ ##################################################
16
+ # Delete blocks #
17
+ # DELETE /suppression/blocks #
18
+
19
+ data = JSON.parse('{
20
+ "delete_all": false,
21
+ "emails": [
22
+ "example1@example.com",
23
+ "example2@example.com"
24
+ ]
25
+ }')
26
+ response = sg.client.suppression.blocks.delete(request_body: data)
27
+ puts response.status_code
28
+ puts response.body
29
+ puts response.headers
30
+
31
+ ##################################################
32
+ # Retrieve a specific block #
33
+ # GET /suppression/blocks/{email} #
34
+
35
+ email = 'test_url_param'
36
+ response = sg.client.suppression.blocks._(email).get
37
+ puts response.status_code
38
+ puts response.body
39
+ puts response.headers
40
+
41
+ ##################################################
42
+ # Delete a specific block #
43
+ # DELETE /suppression/blocks/{email} #
44
+
45
+ email = 'test_url_param'
46
+ response = sg.client.suppression.blocks._(email).delete
47
+ puts response.status_code
48
+ puts response.body
49
+ puts response.headers
50
+
51
+ ##################################################
52
+ # Retrieve all bounces #
53
+ # GET /suppression/bounces #
54
+
55
+ params = JSON.parse('{"start_time": 1, "end_time": 1}')
56
+ response = sg.client.suppression.bounces.get(query_params: params)
57
+ puts response.status_code
58
+ puts response.body
59
+ puts response.headers
60
+
61
+ ##################################################
62
+ # Delete bounces #
63
+ # DELETE /suppression/bounces #
64
+
65
+ data = JSON.parse('{
66
+ "delete_all": true,
67
+ "emails": [
68
+ "example@example.com",
69
+ "example2@example.com"
70
+ ]
71
+ }')
72
+ response = sg.client.suppression.bounces.delete(request_body: data)
73
+ puts response.status_code
74
+ puts response.body
75
+ puts response.headers
76
+
77
+ ##################################################
78
+ # Retrieve a Bounce #
79
+ # GET /suppression/bounces/{email} #
80
+
81
+ email = 'test_url_param'
82
+ response = sg.client.suppression.bounces._(email).get
83
+ puts response.status_code
84
+ puts response.body
85
+ puts response.headers
86
+
87
+ ##################################################
88
+ # Delete a bounce #
89
+ # DELETE /suppression/bounces/{email} #
90
+
91
+ params = JSON.parse('{"email_address": "example@example.com"}')
92
+ email = 'test_url_param'
93
+ response = sg.client.suppression.bounces._(email).delete(query_params: params)
94
+ puts response.status_code
95
+ puts response.body
96
+ puts response.headers
97
+
98
+ ##################################################
99
+ # Retrieve all invalid emails #
100
+ # GET /suppression/invalid_emails #
101
+
102
+ params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
103
+ response = sg.client.suppression.invalid_emails.get(query_params: params)
104
+ puts response.status_code
105
+ puts response.body
106
+ puts response.headers
107
+
108
+ ##################################################
109
+ # Delete invalid emails #
110
+ # DELETE /suppression/invalid_emails #
111
+
112
+ data = JSON.parse('{
113
+ "delete_all": false,
114
+ "emails": [
115
+ "example1@example.com",
116
+ "example2@example.com"
117
+ ]
118
+ }')
119
+ response = sg.client.suppression.invalid_emails.delete(request_body: data)
120
+ puts response.status_code
121
+ puts response.body
122
+ puts response.headers
123
+
124
+ ##################################################
125
+ # Retrieve a specific invalid email #
126
+ # GET /suppression/invalid_emails/{email} #
127
+
128
+ email = 'test_url_param'
129
+ response = sg.client.suppression.invalid_emails._(email).get
130
+ puts response.status_code
131
+ puts response.body
132
+ puts response.headers
133
+
134
+ ##################################################
135
+ # Delete a specific invalid email #
136
+ # DELETE /suppression/invalid_emails/{email} #
137
+
138
+ email = 'test_url_param'
139
+ response = sg.client.suppression.invalid_emails._(email).delete
140
+ puts response.status_code
141
+ puts response.body
142
+ puts response.headers
143
+
144
+ ##################################################
145
+ # Retrieve a specific spam report #
146
+ # GET /suppression/spam_report/{email} #
147
+
148
+ email = 'test_url_param'
149
+ response = sg.client.suppression.spam_report._(email).get
150
+ puts response.status_code
151
+ puts response.body
152
+ puts response.headers
153
+
154
+ ##################################################
155
+ # Delete a specific spam report #
156
+ # DELETE /suppression/spam_report/{email} #
157
+
158
+ email = 'test_url_param'
159
+ response = sg.client.suppression.spam_reports._(email).delete
160
+ puts response.status_code
161
+ puts response.body
162
+ puts response.headers
163
+
164
+ ##################################################
165
+ # Retrieve all spam reports #
166
+ # GET /suppression/spam_reports #
167
+
168
+ params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
169
+ response = sg.client.suppression.spam_reports.get(query_params: params)
170
+ puts response.status_code
171
+ puts response.body
172
+ puts response.headers
173
+
174
+ ##################################################
175
+ # Delete spam reports #
176
+ # DELETE /suppression/spam_reports #
177
+
178
+ data = JSON.parse('{
179
+ "delete_all": false,
180
+ "emails": [
181
+ "example1@example.com",
182
+ "example2@example.com"
183
+ ]
184
+ }')
185
+ response = sg.client.suppression.spam_reports.delete(request_body: data)
186
+ puts response.status_code
187
+ puts response.body
188
+ puts response.headers
189
+
190
+ ##################################################
191
+ # Retrieve all global suppressions #
192
+ # GET /suppression/unsubscribes #
193
+
194
+ params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
195
+ response = sg.client.suppression.unsubscribes.get(query_params: params)
196
+ puts response.status_code
197
+ puts response.body
198
+ puts response.headers
@@ -0,0 +1,127 @@
1
+ require 'sendgrid-ruby'
2
+
3
+ sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
4
+
5
+ ##################################################
6
+ # Create a transactional template. #
7
+ # POST /templates #
8
+
9
+ data = JSON.parse('{
10
+ "name": "example_name"
11
+ }')
12
+ response = sg.client.templates.post(request_body: data)
13
+ puts response.status_code
14
+ puts response.body
15
+ puts response.headers
16
+
17
+ ##################################################
18
+ # Retrieve all transactional templates (legacy & dynamic). #
19
+ # GET /templates #
20
+
21
+ params = JSON.parse('{"generations": "legacy,dynamic"}')
22
+ response = sg.client.templates.get(query_params: params)
23
+ puts response.status_code
24
+ puts response.body
25
+ puts response.headers
26
+
27
+ ##################################################
28
+ # Edit a transactional template. #
29
+ # PATCH /templates/{template_id} #
30
+
31
+ data = JSON.parse('{
32
+ "name": "new_example_name"
33
+ }')
34
+ template_id = 'test_url_param'
35
+ response = sg.client.templates._(template_id).patch(request_body: data)
36
+ puts response.status_code
37
+ puts response.body
38
+ puts response.headers
39
+
40
+ ##################################################
41
+ # Retrieve a single transactional template. #
42
+ # GET /templates/{template_id} #
43
+
44
+ template_id = 'test_url_param'
45
+ response = sg.client.templates._(template_id).get
46
+ puts response.status_code
47
+ puts response.body
48
+ puts response.headers
49
+
50
+ ##################################################
51
+ # Delete a template. #
52
+ # DELETE /templates/{template_id} #
53
+
54
+ template_id = 'test_url_param'
55
+ response = sg.client.templates._(template_id).delete
56
+ puts response.status_code
57
+ puts response.body
58
+ puts response.headers
59
+
60
+ ##################################################
61
+ # Create a new transactional template version. #
62
+ # POST /templates/{template_id}/versions #
63
+
64
+ data = JSON.parse('{
65
+ "active": 1,
66
+ "html_content": "<%body%>",
67
+ "name": "example_version_name",
68
+ "plain_content": "<%body%>",
69
+ "subject": "<%subject%>",
70
+ "template_id": "ddb96bbc-9b92-425e-8979-99464621b543"
71
+ }')
72
+ template_id = 'test_url_param'
73
+ response = sg.client.templates._(template_id).versions.post(request_body: data)
74
+ puts response.status_code
75
+ puts response.body
76
+ puts response.headers
77
+
78
+ ##################################################
79
+ # Edit a transactional template version. #
80
+ # PATCH /templates/{template_id}/versions/{version_id} #
81
+
82
+ data = JSON.parse('{
83
+ "active": 1,
84
+ "html_content": "<%body%>",
85
+ "name": "updated_example_name",
86
+ "plain_content": "<%body%>",
87
+ "subject": "<%subject%>"
88
+ }')
89
+ template_id = 'test_url_param'
90
+ version_id = 'test_url_param'
91
+ response = sg.client.templates._(template_id).versions._(version_id).patch(request_body: data)
92
+ puts response.status_code
93
+ puts response.body
94
+ puts response.headers
95
+
96
+ ##################################################
97
+ # Retrieve a specific transactional template version. #
98
+ # GET /templates/{template_id}/versions/{version_id} #
99
+
100
+ template_id = 'test_url_param'
101
+ version_id = 'test_url_param'
102
+ response = sg.client.templates._(template_id).versions._(version_id).get
103
+ puts response.status_code
104
+ puts response.body
105
+ puts response.headers
106
+
107
+ ##################################################
108
+ # Delete a transactional template version. #
109
+ # DELETE /templates/{template_id}/versions/{version_id} #
110
+
111
+ template_id = 'test_url_param'
112
+ version_id = 'test_url_param'
113
+ response = sg.client.templates._(template_id).versions._(version_id).delete
114
+ puts response.status_code
115
+ puts response.body
116
+ puts response.headers
117
+
118
+ ##################################################
119
+ # Activate a transactional template version. #
120
+ # POST /templates/{template_id}/versions/{version_id}/activate #
121
+
122
+ template_id = 'test_url_param'
123
+ version_id = 'test_url_param'
124
+ response = sg.client.templates._(template_id).versions._(version_id).activate.post
125
+ puts response.status_code
126
+ puts response.body
127
+ puts response.headers
@@ -0,0 +1,107 @@
1
+ require 'sendgrid-ruby'
2
+
3
+ sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
4
+
5
+ ##################################################
6
+ # Retrieve Tracking Settings #
7
+ # GET /tracking_settings #
8
+
9
+ params = JSON.parse('{"limit": 1, "offset": 1}')
10
+ response = sg.client.tracking_settings.get(query_params: params)
11
+ puts response.status_code
12
+ puts response.body
13
+ puts response.headers
14
+
15
+ ##################################################
16
+ # Update Click Tracking Settings #
17
+ # PATCH /tracking_settings/click #
18
+
19
+ data = JSON.parse('{
20
+ "enabled": true
21
+ }')
22
+ response = sg.client.tracking_settings.click.patch(request_body: data)
23
+ puts response.status_code
24
+ puts response.body
25
+ puts response.headers
26
+
27
+ ##################################################
28
+ # Retrieve Click Track Settings #
29
+ # GET /tracking_settings/click #
30
+
31
+ response = sg.client.tracking_settings.click.get
32
+ puts response.status_code
33
+ puts response.body
34
+ puts response.headers
35
+
36
+ ##################################################
37
+ # Update Google Analytics Settings #
38
+ # PATCH /tracking_settings/google_analytics #
39
+
40
+ data = JSON.parse('{
41
+ "enabled": true,
42
+ "utm_campaign": "website",
43
+ "utm_content": "",
44
+ "utm_medium": "email",
45
+ "utm_source": "sendgrid.com",
46
+ "utm_term": ""
47
+ }')
48
+ response = sg.client.tracking_settings.google_analytics.patch(request_body: data)
49
+ puts response.status_code
50
+ puts response.body
51
+ puts response.headers
52
+
53
+ ##################################################
54
+ # Retrieve Google Analytics Settings #
55
+ # GET /tracking_settings/google_analytics #
56
+
57
+ response = sg.client.tracking_settings.google_analytics.get
58
+ puts response.status_code
59
+ puts response.body
60
+ puts response.headers
61
+
62
+ ##################################################
63
+ # Update Open Tracking Settings #
64
+ # PATCH /tracking_settings/open #
65
+
66
+ data = JSON.parse('{
67
+ "enabled": true
68
+ }')
69
+ response = sg.client.tracking_settings.open.patch(request_body: data)
70
+ puts response.status_code
71
+ puts response.body
72
+ puts response.headers
73
+
74
+ ##################################################
75
+ # Get Open Tracking Settings #
76
+ # GET /tracking_settings/open #
77
+
78
+ response = sg.client.tracking_settings.open.get
79
+ puts response.status_code
80
+ puts response.body
81
+ puts response.headers
82
+
83
+ ##################################################
84
+ # Update Subscription Tracking Settings #
85
+ # PATCH /tracking_settings/subscription #
86
+
87
+ data = JSON.parse('{
88
+ "enabled": true,
89
+ "html_content": "html content",
90
+ "landing": "landing page html",
91
+ "plain_content": "text content",
92
+ "replace": "replacement tag",
93
+ "url": "url"
94
+ }')
95
+ response = sg.client.tracking_settings.subscription.patch(request_body: data)
96
+ puts response.status_code
97
+ puts response.body
98
+ puts response.headers
99
+
100
+ ##################################################
101
+ # Retrieve Subscription Tracking Settings #
102
+ # GET /tracking_settings/subscription #
103
+
104
+ response = sg.client.tracking_settings.subscription.get
105
+ puts response.status_code
106
+ puts response.body
107
+ puts response.headers