sendgrid-ruby 5.3.0 → 6.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +22 -20
  3. data/CHANGELOG.md +55 -0
  4. data/CODE_OF_CONDUCT.md +57 -25
  5. data/CONTRIBUTING.md +18 -23
  6. data/ISSUE_TEMPLATE.md +26 -0
  7. data/LICENSE.md +21 -0
  8. data/Makefile +7 -0
  9. data/PULL_REQUEST_TEMPLATE.md +31 -0
  10. data/README.md +26 -13
  11. data/Rakefile +1 -1
  12. data/TROUBLESHOOTING.md +22 -16
  13. data/UPGRADE.md +5 -0
  14. data/USAGE.md +1103 -1101
  15. data/USE_CASES.md +248 -18
  16. data/examples/helpers/mail/example.rb +7 -7
  17. data/examples/ips/ips.rb +13 -0
  18. data/examples/mail/mail.rb +2 -2
  19. data/examples/scopes/scopes.rb +49 -3
  20. data/examples/{whitelabel/whitelabel.rb → senderauthentication/senderauthentication.rb} +27 -27
  21. data/examples/suppression/suppression.rb +10 -10
  22. data/lib/sendgrid/client.rb +12 -9
  23. data/lib/sendgrid/helpers/inbound/README.md +22 -5
  24. data/lib/sendgrid/helpers/inbound/app.rb +13 -1
  25. data/lib/sendgrid/helpers/inbound/public/index.html +1 -1
  26. data/lib/sendgrid/helpers/inbound/sample_data/default_data.txt +2 -2
  27. data/lib/sendgrid/helpers/inbound/sample_data/raw_data.txt +2 -2
  28. data/lib/sendgrid/helpers/inbound/sample_data/raw_data_with_attachments.txt +2 -2
  29. data/lib/sendgrid/helpers/inbound/send.rb +2 -2
  30. data/lib/sendgrid/helpers/ip_management/ip_management.rb +17 -0
  31. data/lib/sendgrid/helpers/mail/README.md +1 -1
  32. data/lib/sendgrid/helpers/mail/attachment.rb +24 -1
  33. data/lib/sendgrid/helpers/mail/category.rb +0 -8
  34. data/lib/sendgrid/helpers/mail/content.rb +3 -16
  35. data/lib/sendgrid/helpers/mail/email.rb +3 -16
  36. data/lib/sendgrid/helpers/mail/mail.rb +8 -40
  37. data/lib/sendgrid/helpers/permissions/scope.rb +28 -0
  38. data/lib/sendgrid/helpers/permissions/scopes.yml +309 -0
  39. data/lib/sendgrid/helpers/settings/README.md +1 -1
  40. data/lib/sendgrid/helpers/stats/stats_response.rb +1 -1
  41. data/lib/sendgrid/version.rb +1 -1
  42. data/lib/sendgrid-ruby.rb +2 -0
  43. data/mail_helper_v3.md +9 -9
  44. data/sendgrid-ruby.gemspec +3 -3
  45. data/spec/sendgrid/helpers/ip_management/ip_management_spec.rb +12 -0
  46. data/test/sendgrid/helpers/mail/test_attachment.rb +35 -0
  47. data/test/sendgrid/helpers/mail/test_mail.rb +29 -21
  48. data/test/sendgrid/permissions/test_scopes.rb +38 -0
  49. data/test/sendgrid/test_sendgrid-ruby.rb +21 -13
  50. metadata +22 -11
  51. data/.github/ISSUE_TEMPLATE +0 -17
  52. data/.github/PULL_REQUEST_TEMPLATE +0 -24
  53. data/LICENSE.txt +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 796596b834ff9725ad09dd290829bd710b88789f
4
- data.tar.gz: 1d572c07d391a91a4e3f3c279b3fc9ef74128b83
2
+ SHA256:
3
+ metadata.gz: 55bf390189f4cd0b16be070f03374d2c3acfbd0ad99ac92acbc531fb9a0e193f
4
+ data.tar.gz: 245ea8f376252fa963314eaf3680c6552e250d99184d6002fb1e0f9ea02c0473
5
5
  SHA512:
6
- metadata.gz: 5285bba04ae710a028e424ce7b34676e09a4dbf5b2c20eed61205078d97011a3aadbea65f6562dd84883b6583203f28751834ecde2ad225bdcd7ba5bb8ef71dd
7
- data.tar.gz: e5eb5ec7768129a04c65fcc4e5e3f2ab88013f4d6d79eec9252ed20f72fb3120d10527efda11127e80440f10b1e5a3e72c568afa7b094ceac4b1196424b53804
6
+ metadata.gz: c6a0f18a3efb5331dc4339407b963398815168de2b29b807536e24c74590476761558739d74146f781c2bf3c4552a6afaa15ccdfb809cf97bf05abf437937694
7
+ data.tar.gz: dfdcfd458cb2d01ef55e480a26cbdbbf1d0135f3379fc0aa534ac58e45c382d374d17fff201093f3db592046180ed327b8beb2deb39b1f51d68ca0581e538863
data/.travis.yml CHANGED
@@ -1,8 +1,10 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.6
4
- - 2.3.4
5
- - 2.4.1
3
+ - ruby-head
4
+ - 2.6
5
+ - 2.5
6
+ - 2.4
7
+ - jruby
6
8
  gemfile:
7
9
  - gemfiles/Sinatra_1.gemfile
8
10
  - gemfiles/Sinatra_2.gemfile
@@ -10,20 +12,20 @@ before_script:
10
12
  - mkdir prism
11
13
  - mkdir prism/bin
12
14
  - export PATH=$PATH:$PWD/prism/bin/
13
- - ./test/prism.sh
14
- notifications:
15
- hipchat:
16
- rooms:
17
- secure: gYBEwOGBTxHE2nrxsHQqp2UdjRtCX04wVLYEimeT9RG/0LClS4nzJF7DaXLWlAwgLPmk+KV2+nXuLO5oausBr9ODmWhho8G0F90RPR47NupcvT1RM+I2ZbxSjHCUICL22mdnZd8ye/mrk/YtFWYmgmH7ILRK3BuYovXFoKoRnLg=
18
- template:
19
- - '<a href="https://travis-ci.org/%{repository}/builds/%{build_id}">%{repository}
20
- Build %{build_number}</a> on branch <i>%{branch}</i> by %{author}: <strong>%{message}</strong>
21
- <a href="https://github.com/sendgrid/%{repository}/commits/%{commit}">View on GitHub</a>'
22
- format: html
23
- notify: false
24
- script:
25
- - rake test
26
- - rake spec
27
- before_install:
28
- - gem update bundler
29
-
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,61 @@
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
+
4
59
  ## [5.3.0] - 2018-10-12 ##
5
60
  ### Added
6
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!
data/CODE_OF_CONDUCT.md CHANGED
@@ -1,41 +1,73 @@
1
- # SendGrid Community Code of Conduct
1
+ # Contributor Covenant Code of Conduct
2
2
 
3
- The SendGrid open source community is made up of members from around the globe with a diverse set of skills, personalities, and experiences. It is through these differences that our community experiences successes and continued growth. When you're working with members of the community, we encourage you to follow these guidelines, which help steer our interactions and strive to maintain a positive, successful and growing community.
3
+ ## Our Pledge
4
4
 
5
- ### Be Open
6
- Members of the community are open to collaboration, whether it's on pull requests, code reviews, approvals, issues or otherwise. We're receptive to constructive comments and criticism, as the experiences and skill sets of all members contribute to the whole of our efforts. We're accepting of all who wish to take part in our activities, fostering an environment where anyone can participate, and everyone can make a difference.
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.
7
11
 
8
- ### Be Considerate
9
- Members of the community are considerate of their peers, which include other contributors and users of SendGrid. We're thoughtful when addressing the efforts of others, keeping in mind that often the labor was completed with the intent of the good of the community. We're attentive in our communications, whether in person or online, and we're tactful when approaching differing views.
12
+ ## Our Standards
10
13
 
11
- ### Be Respectful
12
- Members of the community are respectful. We're respectful of others, their positions, their skills, their commitments and their efforts. We're respectful of the volunteer efforts that permeate the SendGrid community. We're respectful of the processes outlined in the community, and we work within them. When we disagree, we are courteous in raising our issues. Overall, we're good to each other. We contribute to this community not because we have to, but because we want to. If we remember that, these guidelines will come naturally.
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
13
16
 
14
- ## Additional Guidance
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
15
22
 
16
- ### Disclose Potential Conflicts of Interest
17
- Community discussions often involve interested parties. We expect participants to be aware when they are conflicted due to employment or other projects they are involved in and disclose those interests to other project members. When in doubt, over-disclose. Perceived conflicts of interest are important to address so that the community’s decisions are credible even when unpopular, difficult or favorable to the interests of one group over another.
23
+ Examples of unacceptable behavior by participants include:
18
24
 
19
- ### Interpretation
20
- This Code is not exhaustive or complete. It is not a rulebook; it serves to distill our common understanding of a collaborative, shared environment and goals. We expect it to be followed in spirit as much as in the letter. When in doubt, try to abide by [SendGrid’s cultural values](https://sendgrid.com/blog/employee-engagement-the-4h-way) defined by our “4H’s”: Happy, Hungry, Humble and Honest.
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
21
33
 
22
- ### Enforcement
23
- Most members of the SendGrid community always comply with this Code, not because of the existence of this Code, but because they have long experience participating in open source communities where the conduct described above is normal and expected. However, failure to observe this Code may be grounds for suspension, reporting the user for abuse or changing permissions for outside contributors.
34
+ ## Our Responsibilities
24
35
 
25
- ## If you have concerns about someone’s conduct
26
- **Initiate Direct Contact** - It is always appropriate to email a community member (if contact information is available), mention that you think their behavior was out of line, and (if necessary) point them to this Code.
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.
27
39
 
28
- **Discuss Publicly** - Discussing publicly is always acceptable. Note, though, that approaching the person directly may be better, as it tends to make them less defensive, and it respects the time of other community members, so you probably want to try direct contact first.
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.
29
45
 
30
- **Contact the Moderators** - You can reach the SendGrid moderators by emailing dx@sendgrid.com.
46
+ ## Scope
31
47
 
32
- ## Submission to SendGrid Repositories
33
- Finally, just a reminder, changes to the SendGrid repositories will only be accepted upon completion of the [SendGrid Contributor Agreement](https://cla.sendgrid.com).
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.
34
67
 
35
68
  ## Attribution
36
69
 
37
- SendGrid thanks the following, on which it draws for content and inspiration:
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
38
72
 
39
- * [Python Community Code of Conduct](https://www.python.org/psf/codeofconduct/)
40
- * [Open Source Initiative General Code of Conduct](https://opensource.org/codeofconduct)
41
- * [Apache Code of Conduct](https://www.apache.org/foundation/policies/conduct.html)
73
+ [homepage]: https://www.contributor-covenant.org
data/CONTRIBUTING.md CHANGED
@@ -1,35 +1,25 @@
1
- Hello! Thank you for choosing to help contribute to one of the 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.
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
2
 
3
- - [CLAs and CCLAs](#clas-and-cclas)
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
4
  - [Feature Request](#feature-request)
5
5
  - [Submit a Bug Report](#submit-a-bug-report)
6
- - [Please use our Bug Report Template](#please-use-our-bug-report-template)
6
+ - [Please use our Bug Report Template](#please-use-our-bug-report-template)
7
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)
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
14
  - [Understanding the Code Base](#understanding-the-code-base)
15
15
  - [Testing](#testing)
16
16
  - [Style Guidelines & Naming Conventions](#style-guidelines--naming-conventions)
17
17
  - [Creating a Pull Request](#creating-a-pull-request)
18
+ - [Code Reviews](#code-reviews)
18
19
 
19
20
  <a name="roadmap"></a>
20
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.
21
22
 
22
- <a name="cla"></a>
23
- ## CLAs and CCLAs
24
-
25
- Before you get started, SendGrid requires that a SendGrid Contributor License Agreement (CLA) be filled out by every contributor to a SendGrid open source project.
26
-
27
- Our goal with the CLA is to clarify the rights of our contributors and reduce other risks arising from inappropriate contributions. The CLA also clarifies the rights SendGrid holds in each contribution and helps to avoid misunderstandings over what rights each contributor is required to grant to SendGrid when making a contribution. In this way the CLA encourages broad participation by our open source community and helps us build strong open source projects, free from any individual contributor withholding or revoking rights to any contribution.
28
-
29
- SendGrid does not merge a pull request made against a SendGrid open source project until that pull request is associated with a signed CLA. Copies of the CLA are available [here](https://gist.github.com/SendGridDX/98b42c0a5d500058357b80278fde3be8#file-sendgrid_cla).
30
-
31
- When you create a Pull Request, after a few seconds, a comment will appear with a link to the CLA. Click the link and fill out the brief form and then click the "I agree" button and you are all set. You will not be asked to re-sign the CLA unless we make a change.
32
-
33
23
  There are a few ways to contribute, which we'll enumerate below:
34
24
 
35
25
  <a name="feature-request"></a>
@@ -57,7 +47,7 @@ Before you decide to create a new issue, please try the following:
57
47
 
58
48
  ### Please use our Bug Report Template
59
49
 
60
- In order to make the process easier, we've included a [sample bug report template](https://github.com/sendgrid/sendgrid-ruby/.github/ISSUE_TEMPLATE) (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting.
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.
61
51
 
62
52
  <a name="improvements-to-the-codebase"></a>
63
53
  ## Improvements to the Codebase
@@ -89,9 +79,9 @@ We welcome direct contributions to the sendgrid-ruby code base. Thank you!
89
79
  bundle install
90
80
  ```
91
81
 
92
- ## Environment Variables
82
+ ### Environment Variables
93
83
 
94
- First, get your free SendGrid account [here](https://sendgrid.com/free?source=sendgrid-ruby).
84
+ First, get your free Twilio SendGrid account [here](https://sendgrid.com/free?source=sendgrid-ruby).
95
85
 
96
86
  Next, update your environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys).
97
87
 
@@ -217,3 +207,8 @@ Please run your code through:
217
207
  with a clear title and description against the `master` branch. All tests must be passing before we will review the PR.
218
208
 
219
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/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
+
data/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (C) 2020, Twilio SendGrid, Inc. <help@twilio.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
+ of the Software, and to permit persons to whom the Software is furnished to do
10
+ so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/Makefile ADDED
@@ -0,0 +1,7 @@
1
+ .PHONY: install test
2
+
3
+ install:
4
+ gem install bundler:1.14.6; bundle install
5
+
6
+ test:
7
+ bundle exec rake spec
@@ -0,0 +1,31 @@
1
+ <!--
2
+ We appreciate the effort for this pull request but before that please make sure you read the contribution guidelines, then fill out the blanks below.
3
+
4
+ Please format the PR title appropriately based on the type of change:
5
+ <type>[!]: <description>
6
+ Where <type> is one of: docs, chore, feat, fix, test.
7
+ Add a '!' after the type for breaking changes (e.g. feat!: new breaking feature).
8
+
9
+ **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.**
10
+
11
+ Please enter each Issue number you are resolving in your PR after one of the following words [Fixes, Closes, Resolves]. This will auto-link these issues and close them when this PR is merged!
12
+ e.g.
13
+ Fixes #1
14
+ Closes #2
15
+ -->
16
+
17
+ # Fixes #
18
+
19
+ A short description of what this PR does.
20
+
21
+ ### Checklist
22
+ - [ ] I acknowledge that all my contributions will be made under the project's license
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
25
+ - [ ] I have titled the PR appropriately
26
+ - [ ] I have updated my branch with the master branch
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
29
+ - [ ] I have added inline documentation to the code I modified
30
+
31
+ If you have questions, please file a [support ticket](https://twilio.com/help/contact), or create a GitHub Issue in this repository.
data/README.md CHANGED
@@ -1,14 +1,20 @@
1
- ![SendGrid Logo](https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png)
1
+ ![Twilio SendGrid Logo](https://github.com/sendgrid/sendgrid-python/raw/master/twilio_sendgrid_logo.png)
2
2
 
3
- [![Travis Badge](https://travis-ci.org/sendgrid/sendgrid-ruby.svg?branch=master)](https://travis-ci.org/sendgrid/sendgrid-ruby) [![Gem Version](https://badge.fury.io/rb/sendgrid-ruby.svg)](https://badge.fury.io/rb/sendgrid-ruby)[![Email Notifications Badge](https://dx.sendgrid.com/badge/ruby)](https://dx.sendgrid.com/newsletter/ruby)[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt)[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)[![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/sendgrid-ruby.svg)](https://github.com/sendgrid/sendgrid-ruby/graphs/contributors)
3
+ [![Travis Badge](https://travis-ci.org/sendgrid/sendgrid-ruby.svg?branch=master)](https://travis-ci.org/sendgrid/sendgrid-ruby)
4
+ [![Gem Version](https://badge.fury.io/rb/sendgrid-ruby.svg)](https://badge.fury.io/rb/sendgrid-ruby)
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)
7
+ [![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
8
+ [![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/sendgrid-ruby.svg)](https://github.com/sendgrid/sendgrid-ruby/graphs/contributors)
9
+ [![Open Source Helpers](https://www.codetriage.com/sendgrid/sendgrid-ruby/badges/users.svg)](https://www.codetriage.com/sendgrid/sendgrid-ruby)
4
10
 
5
11
  **NEW:** Subscribe to email [notifications](https://dx.sendgrid.com/newsletter/ruby) for releases and breaking changes.
6
12
 
7
- **This library allows you to quickly and easily use the SendGrid Web API v3 via Ruby.**
13
+ **This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via Ruby.**
8
14
 
9
- Version 3.X.X+ of this library provides full support for all SendGrid [Web API v3](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html) endpoints, including the new [v3 /mail/send](https://sendgrid.com/blog/introducing-v3mailsend-sendgrids-new-mail-endpoint).
15
+ Version 3.X.X+ of this library provides full support for all Twilio SendGrid [Web API v3](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html) endpoints, including the new [v3 /mail/send](https://sendgrid.com/blog/introducing-v3mailsend-sendgrids-new-mail-endpoint).
10
16
 
11
- This library represents the beginning of a new path for SendGrid. We want this library to be community driven and SendGrid led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/sendgrid/sendgrid-ruby/issues) and [pull requests](https://github.com/sendgrid/sendgrid-ruby/blob/master/CONTRIBUTING.md) or simply upvote or comment on existing issues or pull requests.
17
+ This library represents the beginning of a new path for Twilio SendGrid. We want this library to be community driven and Twilio SendGrid led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/sendgrid/sendgrid-ruby/issues) and [pull requests](https://github.com/sendgrid/sendgrid-ruby/blob/master/CONTRIBUTING.md) or simply upvote or comment on existing issues or pull requests.
12
18
 
13
19
  Please browse the rest of this README for further details.
14
20
 
@@ -16,6 +22,7 @@ We appreciate your continued support, thank you!
16
22
 
17
23
  # Table of Contents
18
24
 
25
+ * [Announcements](#announcements)
19
26
  * [Installation](#installation)
20
27
  * [Quick Start](#quick-start)
21
28
  * [Processing Inbound Email](#inbound)
@@ -28,13 +35,19 @@ We appreciate your continued support, thank you!
28
35
  * [About](#about)
29
36
  * [License](#license)
30
37
 
38
+ <a name="announcements"></a>
39
+ # Announcements
40
+
41
+ **NEW:** If you're a software engineer who is passionate about #DeveloperExperience and/or #OpenSource, [this is an incredible opportunity to join our #DX team](https://sendgrid.com/careers/role/1421152/?gh_jid=1421152) as a Developer Experience Engineer and work with [@thinkingserious](https://github.com/thinkingserious) and [@aroach](https://github.com/aroach)! Tell your friends :)
42
+
43
+
31
44
  <a name="installation"></a>
32
45
  # Installation
33
46
 
34
47
  ## Prerequisites
35
48
 
36
- - Ruby version >= 2.2
37
- - The SendGrid service, starting at the [free level](https://sendgrid.com/free?source=sendgrid-ruby)
49
+ - Ruby version >= 2.2 (except version [2.6.0](https://github.com/sendgrid/sendgrid-ruby/blob/master/TROUBLESHOOTING.md#ruby-versions))
50
+ - The Twilio SendGrid service, starting at the [free level](https://sendgrid.com/free?source=sendgrid-ruby)
38
51
 
39
52
  ## Setup Environment Variables
40
53
 
@@ -68,7 +81,6 @@ gem install sendgrid-ruby
68
81
  ## Dependencies
69
82
 
70
83
  - [Ruby-HTTP-Client](https://github.com/sendgrid/ruby-http-client)
71
- - [Sinatra](http://www.sinatrarb.com/) - this is only needed if you plan to process [Inbound Email](#inbound).
72
84
 
73
85
  <a name="quick-start"></a>
74
86
  # Quick Start
@@ -85,7 +97,7 @@ include SendGrid
85
97
 
86
98
  from = SendGrid::Email.new(email: 'test@example.com')
87
99
  to = SendGrid::Email.new(email: 'test@example.com')
88
- subject = 'Sending with SendGrid is Fun'
100
+ subject = 'Sending with Twilio SendGrid is Fun'
89
101
  content = SendGrid::Content.new(type: 'text/plain', value: 'and easy to do anywhere, even with Ruby')
90
102
  mail = SendGrid::Mail.new(from, subject, to, content)
91
103
 
@@ -115,7 +127,7 @@ data = JSON.parse('{
115
127
  "email": "test@example.com"
116
128
  }
117
129
  ],
118
- "subject": "Sending with SendGrid is Fun"
130
+ "subject": "Sending with Twilio SendGrid is Fun"
119
131
  }
120
132
  ],
121
133
  "from": {
@@ -168,7 +180,7 @@ Please see [our helper](https://github.com/sendgrid/sendgrid-ruby/tree/master/li
168
180
  <a name="usage"></a>
169
181
  # Usage
170
182
 
171
- - [SendGrid Docs](https://sendgrid.com/docs/API_Reference/index.html)
183
+ - [Twilio SendGrid Docs](https://sendgrid.com/docs/API_Reference/index.html)
172
184
  - [Library Usage Docs](https://github.com/sendgrid/sendgrid-ruby/tree/master/USAGE.md)
173
185
  - [Example Code](https://github.com/sendgrid/sendgrid-ruby/tree/master/examples)
174
186
  - [How-to: Migration from v2 to v3](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/how_to_migrate_from_v2_to_v3_mail_send.html)
@@ -201,6 +213,7 @@ We encourage contribution to our libraries (you might even score some nifty swag
201
213
  - [Bug Reports](https://github.com/sendgrid/sendgrid-ruby/tree/master/CONTRIBUTING.md#submit_a_bug_report)
202
214
  - [Sign the CLA to Create a Pull Request](https://github.com/sendgrid/sendgrid-ruby/tree/master/CONTRIBUTING.md#cla)
203
215
  - [Improvements to the Codebase](https://github.com/sendgrid/sendgrid-ruby/tree/master/CONTRIBUTING.md#improvements_to_the_codebase)
216
+ - [Review Pull Requests](https://github.com/sendgrid/sendgrid-ruby/blob/master/CONTRIBUTING.md#code-reviews)
204
217
 
205
218
  <a name="troubleshooting"></a>
206
219
  # Troubleshooting
@@ -210,10 +223,10 @@ Please see our [troubleshooting guide](https://github.com/sendgrid/sendgrid-ruby
210
223
  <a name="about"></a>
211
224
  # About
212
225
 
213
- sendgrid-ruby is guided and supported by the SendGrid [Developer Experience Team](mailto:dx@sendgrid.com).
226
+ sendgrid-ruby is guided and supported by the [Developer Experience Team](mailto:dx@sendgrid.com).
214
227
 
215
228
  sendgrid-ruby is maintained and funded by SendGrid, Inc. The names and logos for sendgrid-ruby are trademarks of SendGrid, Inc.
216
229
 
217
230
  <a name="license"></a>
218
231
  # License
219
- [The MIT License (MIT)](LICENSE.txt)
232
+ [The MIT License (MIT)](LICENSE.md)
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ require 'rspec/core/rake_task'
4
4
 
5
5
  Rake::TestTask.new do |t|
6
6
  t.libs << 'test'
7
- t.test_files = FileList['test/sendgrid/test*.rb', 'test/sendgrid/helpers/mail/test*.rb']
7
+ t.test_files = FileList['test/sendgrid/test*.rb', 'test/sendgrid/helpers/mail/test*.rb', 'test/sendgrid/helpers/permissions/test*.rb']
8
8
  t.verbose = true
9
9
  end
10
10
 
data/TROUBLESHOOTING.md CHANGED
@@ -1,19 +1,20 @@
1
- If you have a non-library SendGrid issue, please contact our [support team](https://support.sendgrid.com).
1
+ If you have a non-library Twilio SendGrid issue, please contact our [support team](https://support.sendgrid.com).
2
2
 
3
3
  If you can't find a solution below, please open an [issue](https://github.com/sendgrid/sendgrid-ruby/issues).
4
4
 
5
5
 
6
6
  ## Table of Contents
7
7
 
8
- * [Migrating from v2 to v3](#migrating)
9
- * [Continue Using v2](#v2)
10
- * [Testing v3 /mail/send Calls Directly](#testing)
11
- * [Error Messages](#error)
12
- * [Versions](#versions)
13
- * [Environment Variables and Your SendGrid API Key](#environment)
14
- * [Using the Package Manager](#package-manager)
8
+ * [Migrating from v2 to v3](#migrating-from-v2-to-v3)
9
+ * [Continue Using v2](#continue-using-v2)
10
+ * [Testing v3 /mail/send Calls Directly](#testing-v3-mailsend-calls-directly)
11
+ * [Error Messages](#error-messages)
12
+ * [Versioning](#versioning)
13
+ * [Environment Variables and Your Twilio SendGrid API Key](#environment-variables-and-your-twilio-sendgrid-api-key)
14
+ * [Using the Package Manager](#using-the-package-manager)
15
15
  * [Rails Specifics](#rails-specifics)
16
- * [Viewing the Request Body](#request-body)
16
+ * [Ruby Versions](#ruby-versions)
17
+ * [Viewing the Request Body](#viewing-the-request-body)
17
18
 
18
19
  <a name="migrating"></a>
19
20
  ## Migrating from v2 to v3
@@ -52,7 +53,7 @@ Click the "Clone or download" green button in [GitHub](https://github.com/sendgr
52
53
  <a name="testing"></a>
53
54
  ## Testing v3 /mail/send Calls Directly
54
55
 
55
- [Here](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/curl_examples.html) are some cURL examples for common use cases.
56
+ [Here](https://sendgrid.com/docs/for-developers/sending-email/curl-examples/) are some cURL examples for common use cases.
56
57
 
57
58
  <a name="error"></a>
58
59
  ## Error Messages
@@ -67,17 +68,17 @@ rescue Exception => e
67
68
  end
68
69
  ```
69
70
 
70
- <a name="versions"></a>
71
- ## Versions
71
+ <a name="versioning"></a>
72
+ ## Versioning
72
73
 
73
74
  We follow the MAJOR.MINOR.PATCH versioning scheme as described by [SemVer.org](http://semver.org). Therefore, we recommend that you always pin (or vendor) the particular version you are working with to your code and never auto-update to the latest version. Especially when there is a MAJOR point release, since that is guaranteed to be a breaking change. Changes are documented in the [CHANGELOG](https://github.com/sendgrid/sendgrid-ruby/blob/master/CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-ruby/releases) section.
74
75
 
75
76
  <a name="environment"></a>
76
- ## Environment Variables and Your SendGrid API Key
77
+ ## Environment Variables and Your Twilio SendGrid API Key
77
78
 
78
- All of our examples assume you are using [environment variables](https://github.com/sendgrid/sendgrid-ruby#setup-environment-variables) to hold your SendGrid API key.
79
+ All of our examples assume you are using [environment variables](https://github.com/sendgrid/sendgrid-ruby#setup-environment-variables) to hold your Twilio SendGrid API key.
79
80
 
80
- If you choose to add your SendGrid API key directly (not recommended):
81
+ If you choose to add your Twilio SendGrid API key directly (not recommended):
81
82
 
82
83
  `sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])`
83
84
 
@@ -85,7 +86,7 @@ becomes
85
86
 
86
87
  `sg = SendGrid::API.new(api_key: 'SENDGRID_API_KEY')`
87
88
 
88
- In the first case SENDGRID_API_KEY is in reference to the name of the environment variable, while the second case references the actual SendGrid API Key.
89
+ In the first case SENDGRID_API_KEY is in reference to the name of the environment variable, while the second case references the actual Twilio SendGrid API Key.
89
90
 
90
91
  <a name="package-manager"></a>
91
92
  ## Using the Package Manager
@@ -119,6 +120,11 @@ gem install sendgrid-ruby -v X.X.X
119
120
 
120
121
  - Possibility of a namespace collision between the sendgrid class `Email` and your own defined `Email` class. To avoid these issues, you can skip the `include SendGrid` line and use the `SendGrid::` prefix for Email. Please see this [SO answer](https://stackoverflow.com/questions/41508464/rails-model-name-conflict-with-included-gem?noredirect=1#comment70223099_41508464) for specifics.
121
122
 
123
+ <a name="ruby-versions"></a>
124
+ ## Ruby Versions
125
+
126
+ This SDK [does not work with ruby version 2.6.0](https://github.com/sendgrid/sendgrid-ruby/issues/378) because of [this bug](https://bugs.ruby-lang.org/issues/15468). Please use any other [supported version](https://github.com/sendgrid/sendgrid-ruby#prerequisites).
127
+
122
128
  <a name="request-body"></a>
123
129
  ## Viewing the Request Body
124
130
 
data/UPGRADE.md ADDED
@@ -0,0 +1,5 @@
1
+ # Upgrading from 5.X to 6.X
2
+
3
+ Note, this is only necessary if you are using inbound processing.
4
+
5
+ * Add this gem to your Gemfile: `gem 'sinatra', '>= 1.4.7', '< 3'`