sendgrid-ruby 6.3.4 → 6.3.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +7 -5
  3. data/.rubocop_todo.yml +109 -0
  4. data/.travis.yml +1 -2
  5. data/CHANGELOG.md +43 -1
  6. data/CONTRIBUTING.md +2 -5
  7. data/FIRST_TIMERS.md +7 -7
  8. data/{LICENSE.md → LICENSE} +1 -1
  9. data/Makefile +1 -0
  10. data/PULL_REQUEST_TEMPLATE.md +4 -4
  11. data/README.md +3 -9
  12. data/Rakefile +2 -3
  13. data/USAGE.md +111 -3
  14. data/examples/accesssettings/accesssettings.rb +9 -12
  15. data/examples/alerts/alerts.rb +8 -11
  16. data/examples/apikeys/apikeys.rb +12 -15
  17. data/examples/asm/asm.rb +27 -30
  18. data/examples/browsers/browsers.rb +0 -3
  19. data/examples/campaigns/campaigns.rb +29 -32
  20. data/examples/categories/categories.rb +0 -3
  21. data/examples/clients/clients.rb +1 -4
  22. data/examples/contactdb/contactdb.rb +63 -66
  23. data/examples/devices/devices.rb +0 -3
  24. data/examples/emailactivity/emailactivity.rb +52 -0
  25. data/examples/geo/geo.rb +0 -3
  26. data/examples/helpers/eventwebhook/example.rb +4 -4
  27. data/examples/helpers/mail/example.rb +9 -10
  28. data/examples/helpers/settings/example.rb +1 -1
  29. data/examples/helpers/stats/example.rb +4 -4
  30. data/examples/ips/ips.rb +19 -22
  31. data/examples/mail/mail.rb +72 -75
  32. data/examples/mailboxproviders/mailboxproviders.rb +0 -3
  33. data/examples/mailsettings/mailsettings.rb +21 -24
  34. data/examples/partnersettings/partnersettings.rb +3 -6
  35. data/examples/scopes/scopes.rb +8 -10
  36. data/examples/senderauthentication/senderauthentication.rb +41 -44
  37. data/examples/senders/senders.rb +28 -31
  38. data/examples/stats/stats.rb +0 -3
  39. data/examples/subusers/subusers.rb +17 -20
  40. data/examples/suppression/suppression.rb +15 -18
  41. data/examples/templates/templates.rb +29 -31
  42. data/examples/trackingsettings/trackingsettings.rb +14 -17
  43. data/examples/user/user.rb +41 -44
  44. data/lib/rack/sendgrid_webhook_verification.rb +5 -2
  45. data/lib/sendgrid/base_interface.rb +2 -1
  46. data/lib/sendgrid/helpers/eventwebhook/eventwebhook.rb +4 -6
  47. data/lib/sendgrid/helpers/inbound/app.rb +2 -2
  48. data/lib/sendgrid/helpers/inbound/send.rb +3 -3
  49. data/lib/sendgrid/helpers/ip_management/ip_management.rb +1 -1
  50. data/lib/sendgrid/helpers/mail/asm.rb +6 -18
  51. data/lib/sendgrid/helpers/mail/attachment.rb +12 -42
  52. data/lib/sendgrid/helpers/mail/bcc_settings.rb +6 -18
  53. data/lib/sendgrid/helpers/mail/bypass_list_management.rb +8 -18
  54. data/lib/sendgrid/helpers/mail/category.rb +2 -2
  55. data/lib/sendgrid/helpers/mail/click_tracking.rb +6 -18
  56. data/lib/sendgrid/helpers/mail/content.rb +4 -3
  57. data/lib/sendgrid/helpers/mail/custom_arg.rb +6 -10
  58. data/lib/sendgrid/helpers/mail/email.rb +10 -5
  59. data/lib/sendgrid/helpers/mail/footer.rb +7 -27
  60. data/lib/sendgrid/helpers/mail/ganalytics.rb +10 -54
  61. data/lib/sendgrid/helpers/mail/header.rb +6 -10
  62. data/lib/sendgrid/helpers/mail/mail.rb +32 -48
  63. data/lib/sendgrid/helpers/mail/mail_settings.rb +9 -25
  64. data/lib/sendgrid/helpers/mail/open_tracking.rb +6 -18
  65. data/lib/sendgrid/helpers/mail/personalization.rb +34 -27
  66. data/lib/sendgrid/helpers/mail/section.rb +6 -10
  67. data/lib/sendgrid/helpers/mail/spam_check.rb +7 -27
  68. data/lib/sendgrid/helpers/mail/subscription_tracking.rb +8 -36
  69. data/lib/sendgrid/helpers/mail/substitution.rb +6 -10
  70. data/lib/sendgrid/helpers/mail/tracking_settings.rb +8 -20
  71. data/lib/sendgrid/helpers/permissions/scope.rb +2 -2
  72. data/lib/sendgrid/helpers/settings/settings.rb +1 -1
  73. data/lib/sendgrid/helpers/settings/tracking_settings_dto.rb +3 -5
  74. data/lib/sendgrid/helpers/stats/metrics.rb +5 -5
  75. data/lib/sendgrid/sendgrid.rb +1 -1
  76. data/lib/sendgrid/twilio_email.rb +1 -1
  77. data/lib/sendgrid/version.rb +1 -1
  78. data/mail_helper_v3.md +3 -3
  79. data/sendgrid-ruby.gemspec +7 -8
  80. data/spec/fixtures/event_webhook.rb +17 -11
  81. data/spec/rack/sendgrid_webhook_verification_spec.rb +30 -4
  82. data/spec/sendgrid/helpers/eventwebhook/eventwebhook_spec.rb +38 -36
  83. data/spec/sendgrid/helpers/settings/mail_settings_dto_spec.rb +1 -1
  84. data/spec/sendgrid/helpers/settings/partner_settings_dto_spec.rb +1 -1
  85. data/spec/sendgrid/helpers/settings/settings_spec.rb +2 -2
  86. data/spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb +1 -1
  87. data/spec/sendgrid/helpers/settings/user_settings_dto_spec.rb +1 -1
  88. data/spec/sendgrid/helpers/stats/email_stats_spec.rb +22 -23
  89. data/spec/sendgrid/helpers/stats/metrics_spec.rb +19 -20
  90. data/spec/sendgrid/helpers/stats/stats_response_spec.rb +22 -23
  91. data/spec/spec_helper.rb +1 -1
  92. data/test/sendgrid/helpers/mail/test_attachment.rb +4 -6
  93. data/test/sendgrid/helpers/mail/test_category.rb +0 -2
  94. data/test/sendgrid/helpers/mail/test_email.rb +17 -10
  95. data/test/sendgrid/helpers/mail/test_mail.rb +101 -102
  96. data/test/sendgrid/helpers/mail/test_personalizations.rb +133 -93
  97. data/test/sendgrid/permissions/test_scopes.rb +1 -3
  98. data/test/sendgrid/test_sendgrid-ruby.rb +1947 -1948
  99. data/use-cases/legacy-templates.md +1 -1
  100. data/use-cases/transactional-templates.md +1 -1
  101. metadata +39 -37
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b7ceda12fd42d78b3d9be742691aa04943810f7aaaeee00ebddded73004bb0b
4
- data.tar.gz: c0dfae6e4e0a91ebf5816f8d2b4ce8dfcc4857be2e5d31dd1289f71b0b4f1845
3
+ metadata.gz: bf21bd306727e384a838c428f07f5866f9108ab03f41160b8dfe429d3116537b
4
+ data.tar.gz: b73d7dfbb09c9d817096762a882e85e1eeb77bd2abd3397d45923fcf4f81b4cc
5
5
  SHA512:
6
- metadata.gz: 77d07eaf2f1b79970ec14246a185b97fb00b860831bad8db6570c8230d708f2621889eb10baeddf8f58deda706dc2ef88ba350a9fa0df25c135f03b28a8ba2db
7
- data.tar.gz: 86c963fea6f7def49fbec7399c46862244cc9bf551f9b77894458311f676fe46b66be1b87621efcf4cee702dd9d136808df66d8727108aaea5e7e15b2b751d3d
6
+ metadata.gz: 52f3285d9ff1f54c4fd46372118de4847fb7508e8c28720362d66aebde5f67decb780a51a9fdaa295d4a67c38bae70ae484ab17ec53e80b38aa8a614de7a0083
7
+ data.tar.gz: 21b3545263c927498194e31f628d91ded1d6ba39da5e81865a3368729a804338be697f6cb9ca9c89ddeb0dcebca7635b4c8a1a7c99516cf3b8c4425c2bca8688
@@ -1,6 +1,8 @@
1
- AllCops:
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ Style/StringLiterals:
4
+ Enabled: false
5
+
6
+ Metrics/BlockLength:
2
7
  Exclude:
3
- - examples/**/*
4
- - gemfiles/**/*
5
- - spec/**/*
6
- - test/**/*
8
+ - 'spec/**/*'
@@ -0,0 +1,109 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2020-09-18 20:20:54 UTC using RuboCop version 0.91.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Configuration parameters: Include.
11
+ # Include: **/*.gemspec
12
+ Gemspec/RequiredRubyVersion:
13
+ Exclude:
14
+ - 'sendgrid-ruby.gemspec'
15
+
16
+ # Offense count: 22
17
+ Lint/UselessAssignment:
18
+ Exclude:
19
+ - 'examples/scopes/scopes.rb'
20
+ - 'spec/rack/sendgrid_webhook_verification_spec.rb'
21
+
22
+ # Offense count: 8
23
+ # Configuration parameters: IgnoredMethods.
24
+ Metrics/AbcSize:
25
+ Max: 144
26
+
27
+ # Offense count: 9
28
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
29
+ # ExcludedMethods: refine
30
+ Metrics/BlockLength:
31
+ Max: 96
32
+
33
+ # Offense count: 3
34
+ # Configuration parameters: CountComments, CountAsOne.
35
+ Metrics/ClassLength:
36
+ Max: 2006
37
+
38
+ # Offense count: 41
39
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
40
+ Metrics/MethodLength:
41
+ Max: 141
42
+
43
+ # Offense count: 2
44
+ # Configuration parameters: CountKeywordArgs.
45
+ Metrics/ParameterLists:
46
+ Max: 7
47
+
48
+ # Offense count: 4
49
+ # Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, Regex, IgnoreExecutableScripts, AllowedAcronyms.
50
+ # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
51
+ Naming/FileName:
52
+ Exclude:
53
+ - 'gemfiles/Sinatra_1.gemfile'
54
+ - 'gemfiles/Sinatra_2.gemfile'
55
+ - 'lib/sendgrid-ruby.rb'
56
+ - 'test/sendgrid/test_sendgrid-ruby.rb'
57
+
58
+ # Offense count: 1
59
+ # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
60
+ # AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
61
+ Naming/MethodParameterName:
62
+ Exclude:
63
+ - 'lib/sendgrid/helpers/mail/personalization.rb'
64
+
65
+ # Offense count: 1
66
+ # Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
67
+ # NamePrefix: is_, has_, have_
68
+ # ForbiddenPrefixes: is_, has_, have_
69
+ # AllowedMethods: is_a?
70
+ # MethodDefinitionMacros: define_method, define_singleton_method
71
+ Naming/PredicateName:
72
+ Exclude:
73
+ - 'spec/**/*'
74
+ - 'examples/helpers/eventwebhook/example.rb'
75
+
76
+ # Offense count: 35
77
+ Style/Documentation:
78
+ Enabled: false
79
+
80
+ # Offense count: 4
81
+ # Configuration parameters: EnforcedStyle.
82
+ # SupportedStyles: annotated, template, unannotated
83
+ Style/FormatStringToken:
84
+ Exclude:
85
+ - 'examples/emailactivity/emailactivity.rb'
86
+
87
+ # Offense count: 97
88
+ # Cop supports --auto-correct.
89
+ # Configuration parameters: EnforcedStyle.
90
+ # SupportedStyles: always, always_true, never
91
+ Style/FrozenStringLiteralComment:
92
+ Enabled: false
93
+
94
+ # Offense count: 6
95
+ Style/MixinUsage:
96
+ Exclude:
97
+ - 'examples/helpers/eventwebhook/example.rb'
98
+ - 'examples/helpers/mail/example.rb'
99
+ - 'examples/helpers/settings/example.rb'
100
+ - 'examples/helpers/stats/example.rb'
101
+ - 'test/sendgrid/helpers/mail/test_attachment.rb'
102
+ - 'test/sendgrid/helpers/mail/test_mail.rb'
103
+
104
+ # Offense count: 55
105
+ # Cop supports --auto-correct.
106
+ # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
107
+ # URISchemes: http, https
108
+ Layout/LineLength:
109
+ Max: 3211
@@ -14,8 +14,7 @@ script: make test-docker
14
14
 
15
15
  deploy:
16
16
  provider: rubygems
17
- api_key:
18
- secure: CWlfN170i/fHPrIufHHLWQ0utjuhxf4ELSxKeypIuO2CNTqNMzocDAa2vxMt4XfO6d2wFPV/LC+IHR7i+sp7PKvjRoa4BLUUxjfBNDboc0gGESeUYlAxwsJo0tOVCNmpxgjQKqtPLz/19A/v/xpxLv2Im/9Idqa5ATd06sMDdM8=
17
+ api_key: $RUBYGEMS_API_KEY
19
18
  gem: sendgrid-ruby
20
19
  on:
21
20
  tags: true
@@ -1,6 +1,48 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ [2021-01-27] Version 6.3.9
5
+ --------------------------
6
+ **Library - Fix**
7
+ - [PR #446](https://github.com/sendgrid/sendgrid-ruby/pull/446): Accurate duplicate checking when adding email to Personalizations. Thanks to [@mito5525](https://github.com/mito5525)!
8
+ - [PR #457](https://github.com/sendgrid/sendgrid-ruby/pull/457): email is required. Thanks to [@luk4s](https://github.com/luk4s)!
9
+
10
+
11
+ [2020-12-16] Version 6.3.8
12
+ --------------------------
13
+ **Library - Fix**
14
+ - [PR #448](https://github.com/sendgrid/sendgrid-ruby/pull/448): tests failing on rubocop rule. Thanks to [@thinkingserious](https://github.com/thinkingserious)!
15
+
16
+
17
+ [2020-11-05] Version 6.3.7
18
+ --------------------------
19
+ **Library - Chore**
20
+ - [PR #447](https://github.com/sendgrid/sendgrid-ruby/pull/447): fix rubocop styling errors. Thanks to [@eshanholtz](https://github.com/eshanholtz)!
21
+
22
+
23
+ [2020-10-14] Version 6.3.6
24
+ --------------------------
25
+ **Library - Fix**
26
+ - [PR #440](https://github.com/sendgrid/sendgrid-ruby/pull/440): reading position of a request body. Thanks to [@snaka](https://github.com/snaka)!
27
+
28
+
29
+ [2020-09-28] Version 6.3.5
30
+ --------------------------
31
+ **Library - Fix**
32
+ - [PR #437](https://github.com/sendgrid/sendgrid-ruby/pull/437): Raise error when adding duplicate email address in Personalizations. Thanks to [@Pranc1ngPegasus](https://github.com/Pranc1ngPegasus)!
33
+
34
+ **Library - Docs**
35
+ - [PR #322](https://github.com/sendgrid/sendgrid-ruby/pull/322): Update documentation for retrieving a list of all templates. Thanks to [@renshuki](https://github.com/renshuki)!
36
+ - [PR #332](https://github.com/sendgrid/sendgrid-ruby/pull/332): Add Email activity API Documentation. Thanks to [@dhoeric](https://github.com/dhoeric)!
37
+
38
+ **Library - Test**
39
+ - [PR #315](https://github.com/sendgrid/sendgrid-ruby/pull/315): Add rubocop check to CI. Thanks to [@dipil-saud](https://github.com/dipil-saud)!
40
+
41
+ **Library - Chore**
42
+ - [PR #339](https://github.com/sendgrid/sendgrid-ruby/pull/339): Added rubocop configs and changed source files with rubocop "offenses". Thanks to [@douglaslise](https://github.com/douglaslise)!
43
+ - [PR #338](https://github.com/sendgrid/sendgrid-ruby/pull/338): Refactor getters and setters to use ruby accessors. Thanks to [@douglaslise](https://github.com/douglaslise)!
44
+
45
+
4
46
  [2020-08-19] Version 6.3.4
5
47
  --------------------------
6
48
  **Library - Docs**
@@ -171,7 +213,7 @@ All notable changes to this project will be documented in this file.
171
213
 
172
214
  ## [5.2.0] - 2017-10-30 ##
173
215
  ### Added
174
- - PR #234: Helpers for email statistics - global, category, subuser
216
+ - PR #234: Helpers for email statistics - global, category, subuser
175
217
  - Thanks to [Awin Abi](https://github.com/awinabi) for the pull request!
176
218
 
177
219
  ## [5.1.0] - 2017-9-1 ##
@@ -17,9 +17,6 @@ Hello! Thank you for choosing to help contribute to one of the Twilio SendGrid o
17
17
  - [Creating a Pull Request](#creating-a-pull-request)
18
18
  - [Code Reviews](#code-reviews)
19
19
 
20
- <a name="roadmap"></a>
21
- We use [Milestones](https://github.com/sendgrid/sendgrid-ruby/milestones) to help define current roadmaps, please feel free to grab an issue from the current milestone. Please indicate that you have begun work on it to avoid collisions. Once a PR is made, community review, comments, suggestions, and additional PRs are welcomed and encouraged.
22
-
23
20
  There are a few ways to contribute, which we'll enumerate below:
24
21
 
25
22
  <a name="feature-request"></a>
@@ -152,10 +149,10 @@ Please run your code through:
152
149
  ```bash
153
150
  # Clone your fork of the repo into the current directory
154
151
  git clone https://github.com/sendgrid/sendgrid-ruby
155
-
152
+
156
153
  # Navigate to the newly cloned directory
157
154
  cd sendgrid-ruby
158
-
155
+
159
156
  # Assign the original repo to a remote called "upstream"
160
157
  git remote add upstream https://github.com/sendgrid/sendgrid-ruby
161
158
  ```
@@ -61,13 +61,13 @@ Before creating a pull request, make sure that you respect the repository's cons
61
61
  * [Node.js SDK](https://github.com/sendgrid/sendgrid-nodejs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
62
62
  * [Java SDK](https://github.com/sendgrid/sendgrid-java/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
63
63
  * [Go SDK](https://github.com/sendgrid/sendgrid-go/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
64
- * [Python STMPAPI Client](https://github.com/sendgrid/smtpapi-python/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
65
- * [PHP STMPAPI Client](https://github.com/sendgrid/smtpapi-php/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
66
- * [C# STMPAPI Client](https://github.com/sendgrid/smtpapi-csharp/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
67
- * [Ruby STMPAPI Client](https://github.com/sendgrid/smtpapi-ruby/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
68
- * [Node.js STMPAPI Client](https://github.com/sendgrid/smtpapi-nodejs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
69
- * [Java STMPAPI Client](https://github.com/sendgrid/smtpapi-java/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
70
- * [Go STMPAPI Client](https://github.com/sendgrid/smtpapi-go/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
64
+ * [Python SMTPAPI Client](https://github.com/sendgrid/smtpapi-python/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
65
+ * [PHP SMTPAPI Client](https://github.com/sendgrid/smtpapi-php/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
66
+ * [C# SMTPAPI Client](https://github.com/sendgrid/smtpapi-csharp/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
67
+ * [Ruby SMTPAPI Client](https://github.com/sendgrid/smtpapi-ruby/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
68
+ * [Node.js SMTPAPI Client](https://github.com/sendgrid/smtpapi-nodejs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
69
+ * [Java SMTPAPI Client](https://github.com/sendgrid/smtpapi-java/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
70
+ * [Go SMTPAPI Client](https://github.com/sendgrid/smtpapi-go/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
71
71
  * [Python HTTP Client](https://github.com/sendgrid/python-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
72
72
  * [PHP HTTP Client](https://github.com/sendgrid/php-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
73
73
  * [C# HTTP Client](https://github.com/sendgrid/csharp-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (C) 2020, Twilio SendGrid, Inc. <help@twilio.com>
3
+ Copyright (C) 2021, Twilio SendGrid, Inc. <help@twilio.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
data/Makefile CHANGED
@@ -5,6 +5,7 @@ install:
5
5
 
6
6
  test:
7
7
  bundle exec rake
8
+ rubocop
8
9
 
9
10
  test-integ: test
10
11
 
@@ -19,13 +19,13 @@ Closes #2
19
19
  A short description of what this PR does.
20
20
 
21
21
  ### Checklist
22
- - [ ] I acknowledge that all my contributions will be made under the project's license
22
+ - [x] I acknowledge that all my contributions will be made under the project's license
23
23
  - [ ] I have made a material change to the repo (functionality, testing, spelling, grammar)
24
- - [ ] I have read the [Contribution Guidelines](CONTRIBUTING.md) and my PR follows them
24
+ - [ ] I have read the [Contribution Guidelines](https://github.com/sendgrid/sendgrid-ruby/blob/main/CONTRIBUTING.md) and my PR follows them
25
25
  - [ ] I have titled the PR appropriately
26
26
  - [ ] I have updated my branch with the main branch
27
27
  - [ ] I have added tests that prove my fix is effective or that my feature works
28
- - [ ] I have added necessary documentation about the functionality in the appropriate .md file
28
+ - [ ] I have added the necessary documentation about the functionality in the appropriate .md file
29
29
  - [ ] I have added inline documentation to the code I modified
30
30
 
31
- If you have questions, please file a [support ticket](https://twilio.com/help/contact), or create a GitHub Issue in this repository.
31
+ If you have questions, please file a [support ticket](https://support.sendgrid.com), or create a GitHub Issue in this repository.
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  ![Twilio SendGrid Logo](twilio_sendgrid_logo.png)
2
2
 
3
- [![Travis Badge](https://travis-ci.org/sendgrid/sendgrid-ruby.svg?branch=main)](https://travis-ci.org/sendgrid/sendgrid-ruby)
3
+ [![Travis Badge](https://travis-ci.com/sendgrid/sendgrid-ruby.svg?branch=main)](https://travis-ci.com/sendgrid/sendgrid-ruby)
4
4
  [![Gem Version](https://badge.fury.io/rb/sendgrid-ruby.svg)](https://badge.fury.io/rb/sendgrid-ruby)
5
5
  [![Email Notifications Badge](https://dx.sendgrid.com/badge/ruby)](https://dx.sendgrid.com/newsletter/ruby)
6
- [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.md)
6
+ [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
7
7
  [![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
8
8
  [![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/sendgrid-ruby.svg)](https://github.com/sendgrid/sendgrid-ruby/graphs/contributors)
9
9
  [![Open Source Helpers](https://www.codetriage.com/sendgrid/sendgrid-ruby/badges/users.svg)](https://www.codetriage.com/sendgrid/sendgrid-ruby)
@@ -31,7 +31,6 @@ We appreciate your continued support, thank you!
31
31
  * [Usage](#usage)
32
32
  * [Use Cases](#use_cases)
33
33
  * [Announcements](#announcements)
34
- * [Roadmap](#roadmap)
35
34
  * [How to Contribute](#contribute)
36
35
  * [Troubleshooting](#troubleshooting)
37
36
  * [About](#about)
@@ -195,11 +194,6 @@ Please see our announcement regarding [breaking changes](https://github.com/send
195
194
 
196
195
  All updates to this library are documented in our [CHANGELOG](CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-ruby/releases). You may also subscribe to email [release notifications](https://dx.sendgrid.com/newsletter/ruby) for releases and breaking changes.
197
196
 
198
- <a name="roadmap"></a>
199
- # Roadmap
200
-
201
- 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.
202
-
203
197
  <a name="contribute"></a>
204
198
  # How to Contribute
205
199
 
@@ -226,4 +220,4 @@ If you've instead found a bug in the library or would like new features added, g
226
220
 
227
221
  <a name="license"></a>
228
222
  # License
229
- [The MIT License (MIT)](LICENSE.md)
223
+ [The MIT License (MIT)](LICENSE)
data/Rakefile CHANGED
@@ -10,6 +10,5 @@ end
10
10
 
11
11
  RSpec::Core::RakeTask.new(:spec)
12
12
 
13
- desc "Run tests"
14
- task default: [:spec, :test]
15
-
13
+ desc 'Run tests'
14
+ task default: %i[spec test]
data/USAGE.md CHANGED
@@ -21,6 +21,7 @@ sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
21
21
  * [CLIENTS](#clients)
22
22
  * [CONTACTDB](#contactdb)
23
23
  * [DEVICES](#devices)
24
+ * [EMAIL ACTIVITY](#email-activity)
24
25
  * [GEO](#geo)
25
26
  * [IPS](#ips)
26
27
  * [MAIL](#mail)
@@ -1754,6 +1755,112 @@ puts response.status_code
1754
1755
  puts response.body
1755
1756
  puts response.headers
1756
1757
  ```
1758
+
1759
+ <a name="email-activity"></a>
1760
+ # EMAIL ACTIVITY
1761
+
1762
+ ## Filter all messages
1763
+ > In order to gain access to the Email Activity Feed API, you must purchase [additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity).
1764
+
1765
+ Filter all messages to search your Email Activity.
1766
+
1767
+ Queries may need to be [URL encoded](https://meyerweb.com/eric/tools/dencoder/). URL encoding depends on how you're using the API - if you are trying it out here, or using one of the Libraries, we handle the encoding for you. If you are using cURL, or your own implementation, you probably need to encode it.
1768
+
1769
+ Queries have this format:
1770
+
1771
+ `query={query_type}="{query_content}"`
1772
+
1773
+ encoded, this would look like this:
1774
+
1775
+ `query=type%3D%22query_content%22`
1776
+
1777
+ for example:
1778
+
1779
+ Filter by a specific email - `query=to_email%3D%22example%40example.com%22`
1780
+
1781
+ Filter by subject line - `query=subject%3d%22A%20Great%20Subject%22`
1782
+
1783
+ You can filter by other operators besides `=`. We also accept `!=`, `<`, and `>`.
1784
+
1785
+ For a tutorial on how to get started, check out [Getting Started with the Email Activity API](https://sendgrid.com/docs/API_Reference/Web_API_v3/Tutorials/getting_started_email_activity_api.html).
1786
+
1787
+ For information about building combined queries, see [Building compound Email Activity queries](https://sendgrid.com/docs/API_Reference/Web_API_v3/Tutorials/getting_started_email_activity_api.html#-Creating-compound-queries).
1788
+
1789
+ ### GET /messages
1790
+ ```ruby
1791
+ require 'erb'
1792
+
1793
+ filter_key = 'to_email'
1794
+ filter_operator = ERB::Util.url_encode('=')
1795
+ filter_value = 'testing@sendgrid.net'
1796
+ filter_value = ERB::Util.url_encode(format('"%s"', filter_value))
1797
+ query_params = {}
1798
+ query_params['query'] = format("%s%s%s", filter_key, filter_operator, filter_value)
1799
+ query_params['limit'] = '1'
1800
+
1801
+ params = query_params
1802
+ response = sg.client.messages.get(query_params: params)
1803
+ puts response.status_code
1804
+ puts response.body
1805
+ puts response.headers
1806
+ ```
1807
+
1808
+ ## Filter messages by message ID
1809
+
1810
+ > In order to gain access to the Email Activity Feed API, you must purchase [additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity).
1811
+
1812
+ Get all of the details about the specified message.
1813
+
1814
+ ### GET /messages/{msg_id}
1815
+
1816
+ ```ruby
1817
+ msg_id = "test_url_param"
1818
+ response = sg.client.messages._(msg_id).get()
1819
+ puts response.status_code
1820
+ puts response.body
1821
+ puts response.headers
1822
+ ```
1823
+
1824
+
1825
+ ## Request a CSV
1826
+
1827
+ ### POST /messages/download
1828
+
1829
+ > In order to gain access to the Email Activity Feed API, you must purchase [additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity).
1830
+
1831
+ This request kicks of a process to generate a CSV file. When the file is generated, the email that is listed as the account owner gets an email that links out to the file that is ready for download. The link expires in 3 days.
1832
+
1833
+ The CSV fill contain the last 1 million messages. This endpoint will be rate limited to 1 request every 12 hours.
1834
+
1835
+ ```ruby
1836
+ response = sg.client.messages.download.post()
1837
+ puts response.status_code
1838
+ puts response.body
1839
+ puts response.headers
1840
+ ```
1841
+
1842
+ ## Download CSV
1843
+
1844
+ ### GET /messages/download/{download_uuid}
1845
+
1846
+ > In order to gain access to the Email Activity Feed API, you must purchase [additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity).
1847
+
1848
+ Download the CSV that you requested with the POST Request a CSV.
1849
+
1850
+ When the file is generated, the email that is listed as the account owner gets an email that links out to the file that is ready for download. The link expires in 3 days.
1851
+
1852
+ The CSV fill contain the last 1 million messages. This endpoint will be rate limited to 1 request every 12 hours.
1853
+
1854
+ ```ruby
1855
+ download_uuid = "test_url_param"
1856
+ response = sg.client.messages.download._(download_uuid).get
1857
+ puts response.status_code
1858
+ puts response.body
1859
+ puts response.headers
1860
+ ```
1861
+
1862
+
1863
+
1757
1864
  <a name="geo"></a>
1758
1865
  # GEO
1759
1866
 
@@ -3090,7 +3197,7 @@ puts response.status_code
3090
3197
  puts response.body
3091
3198
  puts response.headers
3092
3199
  ```
3093
- ## Remove an IP from a domain authenticaiton.
3200
+ ## Remove an IP from a domain authentication.
3094
3201
 
3095
3202
  **This endpoint allows you to remove a domain's IP address from that domain's authentication.**
3096
3203
 
@@ -3531,6 +3638,7 @@ puts response.status_code
3531
3638
  puts response.body
3532
3639
  puts response.headers
3533
3640
  ```
3641
+
3534
3642
  ## Retrieve email statistics for your subusers.
3535
3643
 
3536
3644
  **This endpoint allows you to retrieve the email statistics for the given subusers.**
@@ -4144,9 +4252,9 @@ Transactional templates are templates created specifically for transactional ema
4144
4252
 
4145
4253
  ### GET /templates
4146
4254
 
4147
-
4148
4255
  ```ruby
4149
- response = sg.client.templates.get()
4256
+ params = JSON.parse('{"generations": "legacy,dynamic"}')
4257
+ response = sg.client.templates.get(query_params: params)
4150
4258
  puts response.status_code
4151
4259
  puts response.body
4152
4260
  puts response.headers