sendgrid-ruby 1.1.6 → 6.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +5 -5
  2. data/.codeclimate.yml +21 -0
  3. data/.env_sample +1 -3
  4. data/.gitignore +1 -0
  5. data/.travis.yml +28 -17
  6. data/CHANGELOG.md +231 -1
  7. data/CODE_OF_CONDUCT.md +73 -0
  8. data/CONTRIBUTING.md +214 -0
  9. data/Gemfile +5 -4
  10. data/ISSUE_TEMPLATE.md +26 -0
  11. data/LICENSE.md +21 -0
  12. data/Makefile +7 -0
  13. data/PULL_REQUEST_TEMPLATE.md +31 -0
  14. data/README.md +161 -225
  15. data/Rakefile +9 -2
  16. data/TROUBLESHOOTING.md +137 -0
  17. data/UPGRADE.md +5 -0
  18. data/USAGE.md +5037 -0
  19. data/USE_CASES.md +377 -0
  20. data/config.ru +4 -0
  21. data/docker/Dockerfile +12 -0
  22. data/docker/README.md +30 -0
  23. data/examples/accesssettings/accesssettings.rb +83 -0
  24. data/examples/alerts/alerts.rb +62 -0
  25. data/examples/apikeys/apikeys.rb +84 -0
  26. data/examples/asm/asm.rb +173 -0
  27. data/examples/browsers/browsers.rb +16 -0
  28. data/examples/campaigns/campaigns.rb +153 -0
  29. data/examples/categories/categories.rb +36 -0
  30. data/examples/clients/clients.rb +27 -0
  31. data/examples/contactdb/contactdb.rb +395 -0
  32. data/examples/devices/devices.rb +16 -0
  33. data/examples/geo/geo.rb +16 -0
  34. data/examples/helpers/mail/example.rb +147 -0
  35. data/examples/helpers/settings/example.rb +23 -0
  36. data/examples/helpers/stats/example.rb +42 -0
  37. data/examples/ips/ips.rb +167 -0
  38. data/examples/mail/mail.rb +173 -0
  39. data/examples/mailboxproviders/mailboxproviders.rb +16 -0
  40. data/examples/mailsettings/mailsettings.rb +219 -0
  41. data/examples/partnersettings/partnersettings.rb +39 -0
  42. data/examples/scopes/scopes.rb +61 -0
  43. data/examples/senderauthentication/senderauthentication.rb +310 -0
  44. data/examples/senders/senders.rb +98 -0
  45. data/examples/stats/stats.rb +16 -0
  46. data/examples/subusers/subusers.rb +169 -0
  47. data/examples/suppression/suppression.rb +201 -0
  48. data/examples/templates/templates.rb +129 -0
  49. data/examples/trackingsettings/trackingsettings.rb +110 -0
  50. data/examples/user/user.rb +293 -0
  51. data/gemfiles/Sinatra_1.gemfile +6 -0
  52. data/gemfiles/Sinatra_2.gemfile +6 -0
  53. data/lib/sendgrid/client.rb +33 -57
  54. data/lib/sendgrid/helpers/inbound/README.md +98 -0
  55. data/lib/sendgrid/helpers/inbound/app.rb +32 -0
  56. data/lib/sendgrid/helpers/inbound/config.yml +26 -0
  57. data/lib/sendgrid/helpers/inbound/public/index.html +10 -0
  58. data/lib/sendgrid/helpers/inbound/sample_data/default_data.txt +58 -0
  59. data/lib/sendgrid/helpers/inbound/sample_data/raw_data.txt +57 -0
  60. data/lib/sendgrid/helpers/inbound/sample_data/raw_data_with_attachments.txt +298 -0
  61. data/lib/sendgrid/helpers/inbound/send.rb +26 -0
  62. data/lib/sendgrid/helpers/ip_management/ip_management.rb +17 -0
  63. data/lib/sendgrid/helpers/mail/README.md +14 -0
  64. data/lib/sendgrid/helpers/mail/asm.rb +33 -0
  65. data/lib/sendgrid/helpers/mail/attachment.rb +86 -0
  66. data/lib/sendgrid/helpers/mail/bcc_settings.rb +33 -0
  67. data/lib/sendgrid/helpers/mail/bypass_list_management.rb +43 -0
  68. data/lib/sendgrid/helpers/mail/category.rb +20 -0
  69. data/lib/sendgrid/helpers/mail/click_tracking.rb +33 -0
  70. data/lib/sendgrid/helpers/mail/content.rb +20 -0
  71. data/lib/sendgrid/helpers/mail/custom_arg.rb +24 -0
  72. data/lib/sendgrid/helpers/mail/email.rb +29 -0
  73. data/lib/sendgrid/helpers/mail/footer.rb +43 -0
  74. data/lib/sendgrid/helpers/mail/ganalytics.rb +74 -0
  75. data/lib/sendgrid/helpers/mail/header.rb +24 -0
  76. data/lib/sendgrid/helpers/mail/mail.rb +140 -0
  77. data/lib/sendgrid/helpers/mail/mail_settings.rb +63 -0
  78. data/lib/sendgrid/helpers/mail/open_tracking.rb +33 -0
  79. data/lib/sendgrid/helpers/mail/personalization.rb +82 -0
  80. data/lib/sendgrid/helpers/mail/section.rb +24 -0
  81. data/lib/sendgrid/helpers/mail/spam_check.rb +43 -0
  82. data/lib/sendgrid/helpers/mail/subscription_tracking.rb +53 -0
  83. data/lib/sendgrid/helpers/mail/substitution.rb +24 -0
  84. data/lib/sendgrid/helpers/mail/tracking_settings.rb +53 -0
  85. data/lib/sendgrid/helpers/permissions/scope.rb +28 -0
  86. data/lib/sendgrid/helpers/permissions/scopes.yml +309 -0
  87. data/lib/sendgrid/helpers/settings/README.md +14 -0
  88. data/lib/sendgrid/helpers/settings/mail_settings_dto.rb +13 -0
  89. data/lib/sendgrid/helpers/settings/partner_settings_dto.rb +13 -0
  90. data/lib/sendgrid/helpers/settings/settings.rb +28 -0
  91. data/lib/sendgrid/helpers/settings/tracking_settings_dto.rb +24 -0
  92. data/lib/sendgrid/helpers/settings/user_settings_dto.rb +13 -0
  93. data/lib/sendgrid/helpers/stats/email_stats.rb +46 -0
  94. data/lib/sendgrid/helpers/stats/metrics.rb +35 -0
  95. data/lib/sendgrid/helpers/stats/stats_response.rb +31 -0
  96. data/lib/sendgrid/version.rb +1 -1
  97. data/lib/sendgrid-ruby.rb +27 -6
  98. data/mail_helper_v3.md +390 -0
  99. data/sendgrid-ruby.gemspec +13 -17
  100. data/spec/sendgrid/helpers/ip_management/ip_management_spec.rb +12 -0
  101. data/spec/sendgrid/helpers/settings/mail_settings_dto_spec.rb +32 -0
  102. data/spec/sendgrid/helpers/settings/partner_settings_dto_spec.rb +24 -0
  103. data/spec/sendgrid/helpers/settings/settings_spec.rb +25 -0
  104. data/spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb +27 -0
  105. data/spec/sendgrid/helpers/settings/user_settings_dto_spec.rb +24 -0
  106. data/spec/sendgrid/helpers/stats/email_stats_spec.rb +112 -0
  107. data/spec/sendgrid/helpers/stats/metrics_spec.rb +46 -0
  108. data/spec/sendgrid/helpers/stats/stats_response_spec.rb +76 -0
  109. data/spec/spec_helper.rb +10 -1
  110. data/test/prism.sh +42 -0
  111. data/test/sendgrid/helpers/mail/test_attachment.rb +35 -0
  112. data/test/sendgrid/helpers/mail/test_category.rb +27 -0
  113. data/test/sendgrid/helpers/mail/test_email.rb +34 -0
  114. data/test/sendgrid/helpers/mail/test_mail.rb +261 -0
  115. data/test/sendgrid/helpers/mail/test_personalizations.rb +161 -0
  116. data/test/sendgrid/permissions/test_scopes.rb +38 -0
  117. data/test/sendgrid/test_sendgrid-ruby.rb +2751 -0
  118. metadata +149 -115
  119. data/.rspec +0 -2
  120. data/.rubocop.yml +0 -30
  121. data/FETCH_HEAD +0 -0
  122. data/Guardfile +0 -10
  123. data/LICENSE.txt +0 -22
  124. data/example.rb +0 -41
  125. data/lib/sendgrid/exceptions.rb +0 -7
  126. data/lib/sendgrid/mail.rb +0 -182
  127. data/lib/sendgrid/recipient.rb +0 -29
  128. data/lib/sendgrid/response.rb +0 -14
  129. data/lib/sendgrid/template.rb +0 -26
  130. data/lib/sendgrid/template_mailer.rb +0 -59
  131. data/spec/lib/sendgrid/client_spec.rb +0 -87
  132. data/spec/lib/sendgrid/mail_spec.rb +0 -151
  133. data/spec/lib/sendgrid/recipient_spec.rb +0 -91
  134. data/spec/lib/sendgrid/template_mailer_spec.rb +0 -86
  135. data/spec/lib/sendgrid/template_spec.rb +0 -61
  136. data/spec/lib/sendgrid_spec.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: a0997af40965b55afccbb2fd70def32ed7c8213a
4
- data.tar.gz: 2453f6b8577c67c463a30260b5e33e05e5d4d4a9
2
+ SHA256:
3
+ metadata.gz: 55bf390189f4cd0b16be070f03374d2c3acfbd0ad99ac92acbc531fb9a0e193f
4
+ data.tar.gz: 245ea8f376252fa963314eaf3680c6552e250d99184d6002fb1e0f9ea02c0473
5
5
  SHA512:
6
- metadata.gz: 645b595f82306ba093af8d4b6e8465d2e243ca149070a411d5d90295845b8eda5433b6b89c8ffb62db520b949df26a7011d357b978ffa8bce7e1b038b2f0b337
7
- data.tar.gz: 6c982e7e5c6c6c5366cc5332019383114d189b6b4d39092b3c33139e56bed3d85da1596a6a4a9b1fcf3818c7d7f774ea43d7412c0b0cf10f3311d7056b26b652
6
+ metadata.gz: c6a0f18a3efb5331dc4339407b963398815168de2b29b807536e24c74590476761558739d74146f781c2bf3c4552a6afaa15ccdfb809cf97bf05abf437937694
7
+ data.tar.gz: dfdcfd458cb2d01ef55e480a26cbdbbf1d0135f3379fc0aa534ac58e45c382d374d17fff201093f3db592046180ed327b8beb2deb39b1f51d68ca0581e538863
data/.codeclimate.yml ADDED
@@ -0,0 +1,21 @@
1
+ ---
2
+ engines:
3
+ duplication:
4
+ enabled: true
5
+ config:
6
+ languages:
7
+ - ruby
8
+ fixme:
9
+ enabled: true
10
+ rubocop:
11
+ enabled: true
12
+ bundler-audit:
13
+ enabled: true
14
+ ratings:
15
+ paths:
16
+ - "**.rb"
17
+ exclude_paths:
18
+ - examples/
19
+ - spec/
20
+ - test/
21
+ - gemfiles/
data/.env_sample CHANGED
@@ -1,3 +1 @@
1
- SENDGRID_USERNAME=your_sendgrid_username
2
- SENDGRID_PASSWORD=your_sendgrid_password
3
- SENDGRID_APIKEY=your_sendgrid_apikey
1
+ export SENDGRID_API_KEY=''
data/.gitignore CHANGED
@@ -1,6 +1,7 @@
1
1
  # Created by https://www.gitignore.io
2
2
 
3
3
  ### Ruby ###
4
+ bin
4
5
  *.gem
5
6
  *.rbc
6
7
  /.config
data/.travis.yml CHANGED
@@ -1,20 +1,31 @@
1
1
  language: ruby
2
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
3
+ - ruby-head
4
+ - 2.6
5
+ - 2.5
6
+ - 2.4
7
+ - jruby
8
+ gemfile:
9
+ - gemfiles/Sinatra_1.gemfile
10
+ - gemfiles/Sinatra_2.gemfile
16
11
  before_script:
17
- - bundle install
18
- script:
19
- - rubocop --fail-level=E
20
- - rake
12
+ - mkdir prism
13
+ - mkdir prism/bin
14
+ - export PATH=$PATH:$PWD/prism/bin/
15
+ - "./test/prism.sh"
16
+ install: make install
17
+ script: make test
18
+ matrix:
19
+ allow_failures:
20
+ - rvm: ruby-head
21
+ fast_finish: true
22
+ deploy:
23
+ provider: rubygems
24
+ api_key:
25
+ secure: CWlfN170i/fHPrIufHHLWQ0utjuhxf4ELSxKeypIuO2CNTqNMzocDAa2vxMt4XfO6d2wFPV/LC+IHR7i+sp7PKvjRoa4BLUUxjfBNDboc0gGESeUYlAxwsJo0tOVCNmpxgjQKqtPLz/19A/v/xpxLv2Im/9Idqa5ATd06sMDdM8=
26
+ gem: sendgrid-ruby
27
+ on:
28
+ tags: true
29
+ rvm: '2.4'
30
+ gem: gemfiles/Sinatra_1.gemfile
31
+ skip_cleanup: true
data/CHANGELOG.md CHANGED
@@ -1,6 +1,236 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ [2020-01-22] Version 6.0.4
5
+ --------------------------
6
+ **Library - Fix**
7
+ - [PR #404](https://github.com/sendgrid/sendgrid-ruby/pull/404): add skip_cleanup flag to fix travis deploy. Thanks to [@thinkingserious](https://github.com/thinkingserious)!
8
+
9
+
10
+ [2020-01-22] Version 6.0.3
11
+ --------------------------
12
+ **Library - Docs**
13
+ - [PR #402](https://github.com/sendgrid/sendgrid-ruby/pull/402): baseline all the templated markdown docs. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
14
+
15
+
16
+ [2020-01-08] Version 6.0.2
17
+ --------------------------
18
+ **Library - Fix**
19
+ - [PR #401](https://github.com/sendgrid/sendgrid-ruby/pull/401): Only try to deploy once to rubygems. Thanks to [@thinkingserious](https://github.com/thinkingserious)!
20
+
21
+
22
+ [2020-01-03] Version 6.0.1
23
+ --------------------------
24
+ **Library - Chore**
25
+ - [PR #400](https://github.com/sendgrid/sendgrid-ruby/pull/400): Add auto-deploy to travis.yml. Thanks to [@thinkingserious](https://github.com/thinkingserious)!
26
+ - [PR #399](https://github.com/sendgrid/sendgrid-ruby/pull/399): Add testing to Makefile. Thanks to [@thinkingserious](https://github.com/thinkingserious)!
27
+ - [PR #396](https://github.com/sendgrid/sendgrid-ruby/pull/396): Adding Makefile to assist with automation. Thanks to [@thinkingserious](https://github.com/thinkingserious)!
28
+
29
+ **Library - Fix**
30
+ - [PR #321](https://github.com/sendgrid/sendgrid-ruby/pull/321): TROUBLESHOOTING.md broken link fix. Thanks to [@arshadkazmi42](https://github.com/arshadkazmi42)!
31
+
32
+
33
+ [2019-06-04] Version 6.0.0
34
+ --------------------------
35
+ ### BREAKING CHANGE
36
+ - [PR #284](https://github.com/sendgrid/sendgrid-ruby/pull/284): The sinatra gem is no longer specified as a dependency of this gem. If you would like to use the inbound processing, please follow the [upgrade guide](https://github.com/sendgrid/sendgrid-ruby/blob/master/UPGRADE.md). Big thanks to [@jjb](https://github.com/jjb) for the PR!
37
+
38
+ ### Added
39
+ - [PR #271](https://github.com/sendgrid/sendgrid-ruby/pull/271): Add ability to impersonate a subuser. Big thanks to [@danilospa](https://github.com/danilospa) for the PR!
40
+ - [PR #278](https://github.com/sendgrid/sendgrid-ruby/pull/278): Make SendGrid permissions management easy. Big thanks to [@sony-mathew](https://github.com/sony-mathew) for the PR!
41
+ - [PR #343](https://github.com/sendgrid/sendgrid-ruby/pull/343) and [PR #345](https://github.com/sendgrid/sendgrid-ruby/pull/345): Update README.md with examples for dynamic templates and corrections to the old legacy template example. Big thanks to [@kylearoberts](https://github.com/kylearoberts) for the PR!
42
+ - [PR #216](https://github.com/sendgrid/sendgrid-ruby/pull/216): Get unassigned IPs example. Big thanks to [@cristianossd](https://github.com/cristianossd) for the PR!
43
+ - [PR #231](https://github.com/sendgrid/sendgrid-ruby/pull/231): Add support for IO objects set as Attachment content. Big thanks to [@awj](https://github.com/awj) for the PR!
44
+ - [PR #232](https://github.com/sendgrid/sendgrid-ruby/pull/232): Add method to check email content for secret keys. Big thanks to [@jaredsilver](https://github.com/jaredsilver) for the PR!
45
+ - [PR #236](https://github.com/sendgrid/sendgrid-ruby/pull/236): Add an IpManagement helper. Big thanks to [@brokenthumbs](https://github.com/brokenthumbs) for the PR!
46
+ - [PR #264](https://github.com/sendgrid/sendgrid-ruby/pull/264): Add Email Statistics helper example. Big thanks to [@jeremyjung](https://github.com/jeremyjung) for the PR!
47
+ - [PR #246](https://github.com/sendgrid/sendgrid-ruby/pull/246): Modified Mail Class calling examples with SendGrid::Mail. Big thanks to [@rohan-techfreak](https://github.com/rohan-techfreak) for the PR!
48
+ - [PR #268](https://github.com/sendgrid/sendgrid-ruby/pull/268): Added Code Review to CONTRIBUTING.md. Big thanks to [@mptap](https://github.com/mptap) for the PR!
49
+ - [PR #276](https://github.com/sendgrid/sendgrid-ruby/pull/276): Codebase Improvement: Use attr_accessor instead of getters and setters. Big thanks to [@rahul26goyal](https://github.com/rahul26goyal) for the PR!
50
+ - [PR #365](https://github.com/sendgrid/sendgrid-ruby/pull/365): Add our Developer Experience Engineer career opportunity to the README. Big thanks to [@mptap](https://github.com/mptap) for the PR!
51
+
52
+ ### Fixes
53
+ - [PR #262](https://github.com/sendgrid/sendgrid-ruby/pull/262): Fix CONTRIBUTING.md formatting. Big thanks to [@thepriefy](https://github.com/thepriefy) for the PR!
54
+ - [PR #277](https://github.com/sendgrid/sendgrid-ruby/pull/277): Fix travis warning. Big thanks to [@rahul26goyal](https://github.com/rahul26goyal) for the PR!
55
+ - [PR #303](https://github.com/sendgrid/sendgrid-ruby/pull/303): Update readme tags and fix minor test failures. Big thanks to [@af4ro](https://github.com/af4ro) for the PR!
56
+ - [PR #370](https://github.com/sendgrid/sendgrid-ruby/pull/370): Remove references to "Whitelabel". Big thanks to [@crweiner](https://github.com/crweiner) for the PR!
57
+ - [PR #383](https://github.com/sendgrid/sendgrid-ruby/pull/383): Correct endpoint for single spam report requests. Big thanks to [@bermannoah](https://github.com/bermannoah) for the PR!
58
+
59
+ ## [5.3.0] - 2018-10-12 ##
60
+ ### Added
61
+ - [PR #300](https://github.com/sendgrid/sendgrid-ruby/pull/300): Support for Dynamic Templates. Big thanks to [@nedcampion](https://github.com/nedcampion) for the PR!
62
+ - [PR #178](https://github.com/sendgrid/sendgrid-ruby/pull/178): Convert key/value arguments to CustomArgs to strings. Big thanks to [@sitaramshelke](https://github.com/sitaramshelke) for the PR!
63
+ - [PR #258](https://github.com/sendgrid/sendgrid-ruby/pull/258): Added unittest to check for specific repo files. Big thanks to [@mptap](https://github.com/mptap) for the PR!
64
+ - [PR #255](https://github.com/sendgrid/sendgrid-ruby/pull/255): Add a unittest to check the license.md file date range. Big thanks to [@prashuchaudhary](https://github.com/prashuchaudhary) for the PR!
65
+ - [PR #181](https://github.com/sendgrid/sendgrid-ruby/pull/181): Add Docker. Big thanks to [@shrivara](https://github.com/shrivara) for the PR!
66
+ - [PR #248](https://github.com/sendgrid/sendgrid-ruby/pull/248): Added .codeclimate.yml. Big thanks to [@proton](https://github.com/proton) for the PR!
67
+ - [PR #260](https://github.com/sendgrid/sendgrid-ruby/pull/260): Update ruby-http-client dependency to support v3.3.0. Big thanks to [@mptap](https://github.com/mptap) for the PR!
68
+ - [PR #304](https://github.com/sendgrid/sendgrid-ruby/pull/304): Readability update for documentation. Big thanks to [@af4ro](https://github.com/af4ro) for the PR!
69
+ - [PR #306](https://github.com/sendgrid/sendgrid-ruby/pull/306): Update example to work in Rails console. Big thanks to [@RogerPodacter](https://github.com/RogerPodacter) for the PR!
70
+
71
+ ### Fixes
72
+ - [PR #252](https://github.com/sendgrid/sendgrid-ruby/pull/252): Update LICENSE, set correct year. Big thanks to [@pushkyn](https://github.com/pushkyn) for the PR!
73
+ - [PR #257](https://github.com/sendgrid/sendgrid-ruby/pull/257): README.md typo fix. Big thanks to [@shucon](https://github.com/shucon) for the PR!
74
+
75
+ ## [5.2.0] - 2017-10-30 ##
76
+ ### Added
77
+ - PR #234: Helpers for email statistics - global, category, subuser
78
+ - Thanks to [Awin Abi](https://github.com/awinabi) for the pull request!
79
+
80
+ ## [5.1.0] - 2017-9-1 ##
81
+ ### Added
82
+ - #173: Update ruby-http-client dependency
83
+ - [#12](https://github.com/sendgrid/ruby-http-client/pull/12) Add a helper that returns the response body as a hash via the `parsed_body` method in the `Response` object.
84
+ - Thanks to [Diego Camargo](https://github.com/belfazt) for the pull request!
85
+
86
+ ## [5.0.0] - 2017-05-27
87
+ ### BREAKING CHANGE
88
+ - #108 Fix unexpected `Mail` `#categories`, `#categories=` behavior
89
+ - Fixed Issue #95 Refactor Mail Helper Array Assignments
90
+ - `personalization.to` becomes `personalization.add_to()`
91
+ - `personalization.cc` becomes `personalization.add_cc()`
92
+ - `personalization.bcc` becomes `personalization.add_bcc()`
93
+ - `personalization.headers` becomes `personalization.add_header()`
94
+ - `personalization.substitutions` becomes `personalization.add_substitution()`
95
+ - `personalization.custom_args` becomes `personalization.add_custom_arg()`
96
+ - `mail.personalizations` becomes `mail.add_personalization()`
97
+ - `mail.contents` becomes `mail.add_content()`
98
+ - `mail.attachments` becomes `mail.add_attachment()`
99
+ - `mail.sections` becomes `mail.add_section()`
100
+ - `mail.headers` becomes `mail.add_header()`
101
+ - `mail.categories` becomes `mail.add_category()`
102
+ - `mail.custom_args` becomes `mail.custom_args()`
103
+ - For a full example of usage, please [see here](https://github.com/sendgrid/sendgrid-ruby/blob/master/examples/helpers/mail/example.rb#L21).
104
+
105
+ ## [4.3.3] - 2017-5-2
106
+ ### Update
107
+ - #157: Specify required ruby version as '>= 2.2'
108
+ - This library does not support [Ruby 2.1 or below](https://www.ruby-lang.org/en/news/2017/04/01/support-of-ruby-2-1-has-ended/).
109
+ - Thanks to [Ryunosuke Sato](https://github.com/tricknotes) for the pull request!
110
+
111
+ ## [4.3.2] - 2017-5-1 ##
112
+ ### Fixes
113
+ - #161: Fixed problematic Sinatra dependency
114
+ - Brings back Rails 4 compatibility (and Rack 1.x applications, in general), also removes release candidate version constraint (both broken in #160). Moreover, ensures that tests are run against two major Sinatra versions, which should protect from compatibility issues in future, somewhat. Related issue: #159.
115
+ - Thanks to [Sebastian Skałacki](https://github.com/skalee) for the pull request!
116
+
117
+ ## [4.3.1] - 2017-4-12 ##
118
+ ### Fixes
119
+ - #160: Updated sinatra version to 2.0
120
+ - Fixes bundler dependency issues with rails >5.0 and rack 2.0. Solves #159
121
+ - Thanks to [gkats](https://github.com/gkats) for the pull request!
122
+
123
+ ## [4.3.0] - 2017-4-12 ##
124
+ ### Added
125
+ - #70: Adds an account settings management helper object
126
+ - See the [helper README](https://github.com/sendgrid/sendgrid-ruby/tree/master/lib/sendgrid/helpers/settings) for details
127
+ - Thanks to [Kyle Kern](https://github.com/kernkw) for the pull request!
128
+
129
+ ## [4.2.1] - 2017-4-10 ##
130
+ ### Fixed
131
+ - #112: Fixes version ambiguity in gemspec
132
+ - Thanks to [Chris McKnight](https://github.com/cmckni3) for the pull request!
133
+
134
+ ## [4.2.0] - 2017-4-10 ##
135
+ ### Added
136
+ - #148: Set api_key to empty string
137
+ - This makes creating an API key for a SendGrid subuser who does not have an API key easier. See #146 for details
138
+ - Thanks to [Adam Beck](https://github.com/Gwash3189) for the pull request!
139
+
140
+ ## [4.1.1] - 2017-4-6 ##
141
+ ### Fixed
142
+ - #115 #134: Fix typos in initialize methods
143
+ - Thanks to [Ben Jackson](https://github.com/benjackson84) for the pull request!
144
+
145
+ ## [4.1.0] - 2017-4-6 ##
146
+ ### Add
147
+ - #144: Add [Inbound Email Parse Webhook](https://sendgrid.com/docs/API_Reference/Webhooks/inbound_email.html) support
148
+ - Thanks to [Wataru Sato](https://github.com/awwa) for the pull request!
149
+
150
+ ## [4.0.8] - 2017-2-17 ##
151
+ ### Add
152
+ - Solves #147: Add User Agent string
153
+
154
+ ## [4.0.7] - 2017-1-25 ##
155
+ ### Fixes
156
+ - [Pull Request #7](https://github.com/sendgrid/ruby-http-client/pull/7)
157
+ - Fixes [issue #6](https://github.com/sendgrid/ruby-http-client/issues/6): TLS certificates not verified
158
+ - Thanks to [Koen Rouwhorst](https://github.com/koenrh) for the pull request!
159
+
160
+ ## [4.0.6] - 2016-10-18 ##
161
+ ### Added
162
+ - Pull #113: Fix Travis CI Prism functionality for non-SendGrid contributors, update deprecated File.exists
163
+
164
+ ## [4.0.5] - 2016-10-17 ##
165
+ ### Added
166
+ - Pull #110, fixed Issue #109
167
+ - Automates StopLight.io Prism mock server locally & on Travis CI
168
+ - Thanks to [KY](https://github.com/tkbky) for the pull request!
169
+
170
+ ## [4.0.4] - 2016-09-15 ##
171
+ ### Fixed
172
+ - Pull #72: [remove unnecessary ruby 2.2 requirement](https://github.com/sendgrid/sendgrid-ruby/pull/72)
173
+ - Thanks to [Billy Watson](https://github.com/billywatson) for the pull request!
174
+
175
+ ## [4.0.3] - 2016-08-24 ##
176
+ ### Added
177
+ - Table of Contents in the README
178
+ - Added a [USE_CASES.md](https://github.com/sendgrid/sendgrid-ruby/blob/master/USE_CASES.md) section, with the first use case example for transactional templates
179
+
180
+ ## [4.0.2] - 2016-07-26 ##
181
+ ### Fixed
182
+ - Example and USAGE DELETE calls were missing example payloads
183
+
184
+ ## [4.0.1] - 2016-07-25 ##
185
+ ### Added
186
+ - [Troubleshooting](https://github.com/sendgrid/sendgrid-ruby/blob/master/TROUBLESHOOTING.md) section
187
+
188
+ ## [4.0.0] - 2016-07-23 ##
189
+ ### BREAKING CHANGE
190
+ - Update dependency to [ruby-http-client](https://github.com/sendgrid/ruby-http-client/releases/tag/v3.0.0)
191
+ - Response headers now return a hash instead of a string
192
+ - Thanks to [Chris France](https://github.com/hipsterelitist) for the pull request!
193
+
194
+ ## [3.0.7] - 2016-07-20 ##
195
+ ### Added
196
+ - README updates
197
+ - Update introduction blurb to include information regarding our forward path
198
+ - Update the v3 /mail/send example to include non-helper usage
199
+ - Update the generic v3 example to include non-fluent interface usage
200
+
201
+ ## [3.0.6] - 2016-07-05 ##
202
+ ### Added
203
+ - Update docs, unit tests and examples to include Sender ID
204
+
205
+ ## [3.0.5] - 2016-07-05 ##
206
+ ### Added
207
+ - Accept: application/json header per https://sendgrid.com/docs/API_Reference/Web_API_v3/How_To_Use_The_Web_API_v3/requests.html
208
+
209
+ ### Updated
210
+ - Content based on our updated [Swagger/OAI doc](https://github.com/sendgrid/sendgrid-oai)
211
+
212
+ ## [3.0.4] - 2016-06-15 ##
213
+ ### Added
214
+ - Updated dependency on ruby-http-client
215
+
216
+ ## [3.0.3] - 2016-06-15 ##
217
+ ### Fixing
218
+ - Import structure
219
+
220
+ ## [3.0.2] - 2016-06-15 ##
221
+ ### Added
222
+ - Relative import for mail/helper
223
+
224
+ ## [3.0.1] - 2016-06-15 ##
225
+ ### Added
226
+ - Add mail/send helper to the $LOAD_PATH, updated http client dependency
227
+
228
+ ## [3.0.0] - 2016-06-13 ##
229
+ ### Added
230
+ - Breaking change to support the v3 Web API
231
+ - New HTTP client
232
+ - v3 Mail Send helper
233
+
4
234
  ## [1.1.6] - 2015-11-26 ##
5
235
  ## Added
6
236
  Support for cc_name and bcc_name via [#31](https://github.com/sendgrid/sendgrid-ruby/pull/31)
@@ -24,4 +254,4 @@ Inline content support
24
254
 
25
255
  ## [1.0.3] - 2015-10-01 ##
26
256
  ### Fixed
27
- Payload 'to' attribute fix for smtpapi
257
+ Payload 'to' attribute fix for smtpapi
@@ -0,0 +1,73 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, sex characteristics, gender identity and expression,
9
+ level of experience, education, socio-economic status, nationality, personal
10
+ appearance, race, religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ - Using welcoming and inclusive language
18
+ - Being respectful of differing viewpoints and experiences
19
+ - Gracefully accepting constructive criticism
20
+ - Focusing on what is best for the community
21
+ - Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ - The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ - Trolling, insulting/derogatory comments, and personal or political attacks
28
+ - Public or private harassment
29
+ - Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ - Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at open-source@twilio.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
+
73
+ [homepage]: https://www.contributor-covenant.org
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,214 @@
1
+ Hello! Thank you for choosing to help contribute to one of the Twilio SendGrid open-source libraries. There are many ways you can contribute and help is always welcome. We simply ask that you follow the following contribution policies.
2
+
3
+ **All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.**
4
+ - [Feature Request](#feature-request)
5
+ - [Submit a Bug Report](#submit-a-bug-report)
6
+ - [Please use our Bug Report Template](#please-use-our-bug-report-template)
7
+ - [Improvements to the Codebase](#improvements-to-the-codebase)
8
+ - [Development Environment](#development-environment)
9
+ - [Install and Run Locally](#install-and-run-locally)
10
+ - [Prerequisites](#prerequisites)
11
+ - [Initial setup:](#initial-setup)
12
+ - [Environment Variables](#environment-variables)
13
+ - [Execute:](#execute)
14
+ - [Understanding the Code Base](#understanding-the-code-base)
15
+ - [Testing](#testing)
16
+ - [Style Guidelines & Naming Conventions](#style-guidelines--naming-conventions)
17
+ - [Creating a Pull Request](#creating-a-pull-request)
18
+ - [Code Reviews](#code-reviews)
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
+ There are a few ways to contribute, which we'll enumerate below:
24
+
25
+ <a name="feature-request"></a>
26
+ ## Feature Request
27
+
28
+ If you'd like to make a feature request, please read this section.
29
+
30
+ The GitHub issue tracker is the preferred channel for library feature requests, but please respect the following restrictions:
31
+
32
+ - Please **search for existing issues** in order to ensure we don't have duplicate bugs/feature requests.
33
+ - Please be respectful and considerate of others when commenting on issues
34
+
35
+ <a name="submit-a-bug-report"></a>
36
+ ## Submit a Bug Report
37
+
38
+ Note: DO NOT include your credentials in ANY code examples, descriptions, or media you make public.
39
+
40
+ A software bug is a demonstrable issue in the code base. In order for us to diagnose the issue and respond as quickly as possible, please add as much detail as possible into your bug report.
41
+
42
+ Before you decide to create a new issue, please try the following:
43
+
44
+ 1. Check the Github issues tab if the identified issue has already been reported, if so, please add a +1 to the existing post.
45
+ 2. Update to the latest version of this code and check if issue has already been fixed
46
+ 3. Copy and fill in the Bug Report Template we have provided below
47
+
48
+ ### Please use our Bug Report Template
49
+
50
+ In order to make the process easier, we've included a [sample bug report template](https://github.com/sendgrid/sendgrid-ruby/ISSUE_TEMPLATE.md) (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting.
51
+
52
+ <a name="improvements-to-the-codebase"></a>
53
+ ## Improvements to the Codebase
54
+
55
+ We welcome direct contributions to the sendgrid-ruby code base. Thank you!
56
+
57
+ ### Development Environment ###
58
+
59
+ #### Install and Run Locally ####
60
+
61
+ ##### Prerequisites #####
62
+
63
+ - Ruby 2.1+
64
+ - [ruby_http_client](https://github.com/sendgrid/ruby-http-client)
65
+
66
+
67
+ ##### Initial setup: #####
68
+
69
+ 1. Clone the project
70
+
71
+ ```bash
72
+ git clone https://github.com/sendgrid/sendgrid-ruby.git
73
+ cd sendgrid-ruby
74
+ ```
75
+
76
+ 1. Install bundler and bundle
77
+
78
+ ```bash
79
+ bundle install
80
+ ```
81
+
82
+ ### Environment Variables
83
+
84
+ First, get your free Twilio SendGrid account [here](https://sendgrid.com/free?source=sendgrid-ruby).
85
+
86
+ Next, update your environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys).
87
+
88
+ ```bash
89
+ echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
90
+ echo "sendgrid.env" >> .gitignore
91
+ source ./sendgrid.env
92
+ ```
93
+
94
+ ##### Execute: #####
95
+
96
+ See the [examples folder](https://github.com/sendgrid/sendgrid-ruby/tree/master/examples) to get started quickly.
97
+
98
+ To run the examples using the local version of this library from the root directory of this repo, please replace:
99
+
100
+ `require 'sendgrid-ruby'`
101
+
102
+ with:
103
+
104
+ `require_relative './lib/sendgrid-ruby.rb'`
105
+
106
+ Then run using:
107
+
108
+ ```bash
109
+ ruby example.rb
110
+ ```
111
+
112
+ <a name="understanding-the-codebase"></a>
113
+ ## Understanding the Code Base
114
+
115
+ **/examples**
116
+
117
+ Working examples that demonstrate usage.
118
+
119
+ **/test**
120
+
121
+ Tests for the mail send and Web API v3 endpoints.
122
+
123
+ **/lib**
124
+
125
+ The Web API v3 client is `sendgrid-ruby.rb`
126
+
127
+ <a name="testing"></a>
128
+ ## Testing
129
+
130
+ All PRs require passing tests before the PR will be reviewed.
131
+
132
+ All test files are in the [`tests`](https://github.com/sendgrid/sendgrid-ruby/tree/master/test) directory.
133
+
134
+ For the purposes of contributing to this repo, please update the [`test_sendgrid-ruby.rb`](https://github.com/sendgrid/sendgrid-ruby/blob/master/test/test_sendgrid-ruby.rb) file with unit tests as you modify the code.
135
+
136
+ To run the tests:
137
+
138
+ ```bash
139
+ rake
140
+ ```
141
+
142
+ <a name="style-guidelines-and-naming-conventions"></a>
143
+ ## Style Guidelines & Naming Conventions
144
+
145
+ Generally, we follow the style guidelines as suggested by the official language. However, we ask that you conform to the styles that already exist in the library. If you wish to deviate, please explain your reasoning.
146
+
147
+ - [Community Driven Style Guide](https://github.com/bbatsov/ruby-style-guide)
148
+
149
+ Please run your code through:
150
+
151
+ - [rubocop](https://github.com/bbatsov/rubocop).
152
+
153
+ <a name="creating-a-pull-request"></a>
154
+ ## Creating a Pull Request
155
+
156
+ 1. [Fork](https://help.github.com/fork-a-repo/) the project, clone your fork,
157
+ and configure the remotes:
158
+
159
+ ```bash
160
+ # Clone your fork of the repo into the current directory
161
+ git clone https://github.com/sendgrid/sendgrid-ruby
162
+
163
+ # Navigate to the newly cloned directory
164
+ cd sendgrid-ruby
165
+
166
+ # Assign the original repo to a remote called "upstream"
167
+ git remote add upstream https://github.com/sendgrid/sendgrid-ruby
168
+ ```
169
+
170
+ 2. If you cloned a while ago, get the latest changes from upstream:
171
+
172
+ ```bash
173
+ git checkout <dev-branch>
174
+ git pull upstream <dev-branch>
175
+ ```
176
+
177
+ 3. Create a new topic branch (off the main project development branch) to
178
+ contain your feature, change, or fix:
179
+
180
+ ```bash
181
+ git checkout -b <topic-branch-name>
182
+ ```
183
+
184
+ 4. Commit your changes in logical chunks. Please adhere to these [git commit
185
+ message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
186
+ or your code is unlikely be merged into the main project. Use Git's
187
+ [interactive rebase](https://help.github.com/articles/interactive-rebase)
188
+ feature to tidy up your commits before making them public.
189
+
190
+ 4a. Create tests.
191
+
192
+ 4b. Create or update the example code that demonstrates the functionality of this change to the code.
193
+
194
+ 5. Locally merge (or rebase) the upstream development branch into your topic branch:
195
+
196
+ ```bash
197
+ git pull [--rebase] upstream master
198
+ ```
199
+
200
+ 6. Push your topic branch up to your fork:
201
+
202
+ ```bash
203
+ git push origin <topic-branch-name>
204
+ ```
205
+
206
+ 7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
207
+ with a clear title and description against the `master` branch. All tests must be passing before we will review the PR.
208
+
209
+ If you have any additional questions, please feel free to [email](mailto:dx@sendgrid.com) us or create an issue in this repo.
210
+
211
+ <a name="code-reviews"></a>
212
+ ## Code Reviews
213
+
214
+ If you can, please look at open PRs and review them. Give feedback and help us merge these PRs much faster! If you don't know how, Github has some [great information on how to review a Pull Request](https://help.github.com/articles/about-pull-request-reviews/).
data/Gemfile CHANGED
@@ -1,5 +1,6 @@
1
- gem 'dotenv-rails'
2
- gem 'smtpapi'
3
- gem 'rest-client'
4
- source 'https://rubygems.org'
1
+ source 'http://rubygems.org'
2
+
5
3
  gemspec
4
+
5
+ gem 'ruby_http_client'
6
+
data/ISSUE_TEMPLATE.md ADDED
@@ -0,0 +1,26 @@
1
+ <!--
2
+ If this is a feature request, make sure you search Issues for an existing request before creating a new one!
3
+ -->
4
+
5
+ ### Issue Summary
6
+ A summary of the issue and the environment in which it occurs. If suitable, include the steps required to reproduce the bug. Please feel free to include screenshots, screencasts, or code examples.
7
+
8
+ ### Steps to Reproduce
9
+ 1. This is the first step
10
+ 2. This is the second step
11
+ 3. Further steps, etc.
12
+
13
+ ### Code Snippet
14
+ ```ruby
15
+ # paste code here
16
+ ```
17
+
18
+ ### Exception/Log
19
+ ```
20
+ # paste exception/log here
21
+ ```
22
+
23
+ ### Technical details:
24
+ * sendgrid-ruby version:
25
+ * ruby version:
26
+