sendgrid-ruby 6.2.0 → 6.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/config.yml +10 -0
- data/.github/workflows/test-and-deploy.yml +120 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +8 -0
- data/.rubocop_todo.yml +127 -0
- data/CHANGELOG.md +147 -9
- data/CONTRIBUTING.md +11 -21
- data/Dockerfile +14 -0
- data/FIRST_TIMERS.md +79 -0
- data/Gemfile +0 -1
- data/ISSUE_TEMPLATE.md +5 -1
- data/{LICENSE.md → LICENSE} +1 -1
- data/Makefile +9 -2
- data/PULL_REQUEST_TEMPLATE.md +5 -5
- data/README.md +23 -31
- data/Rakefile +2 -3
- data/TROUBLESHOOTING.md +17 -5
- data/USAGE.md +146 -39
- data/examples/accesssettings/accesssettings.rb +9 -12
- data/examples/alerts/alerts.rb +8 -11
- data/examples/apikeys/apikeys.rb +12 -15
- data/examples/asm/asm.rb +27 -30
- data/examples/browsers/browsers.rb +0 -3
- data/examples/campaigns/campaigns.rb +29 -32
- data/examples/categories/categories.rb +0 -3
- data/examples/clients/clients.rb +1 -4
- data/examples/contactdb/contactdb.rb +63 -66
- data/examples/devices/devices.rb +0 -3
- data/examples/emailactivity/emailactivity.rb +52 -0
- data/examples/geo/geo.rb +0 -3
- data/examples/helpers/eventwebhook/example.rb +16 -0
- data/examples/helpers/mail/example.rb +24 -13
- data/examples/helpers/settings/example.rb +1 -1
- data/examples/helpers/stats/example.rb +4 -4
- data/examples/ips/ips.rb +19 -22
- data/examples/mail/mail.rb +72 -75
- data/examples/mailboxproviders/mailboxproviders.rb +0 -3
- data/examples/mailsettings/mailsettings.rb +21 -24
- data/examples/partnersettings/partnersettings.rb +3 -6
- data/examples/scopes/scopes.rb +8 -10
- data/examples/senderauthentication/senderauthentication.rb +41 -44
- data/examples/senders/senders.rb +28 -31
- data/examples/stats/stats.rb +0 -3
- data/examples/subusers/subusers.rb +17 -20
- data/examples/suppression/suppression.rb +15 -18
- data/examples/templates/templates.rb +29 -31
- data/examples/trackingsettings/trackingsettings.rb +14 -17
- data/examples/user/user.rb +41 -44
- data/lib/rack/sendgrid_webhook_verification.rb +55 -0
- data/lib/sendgrid/base_interface.rb +8 -4
- data/lib/sendgrid/helpers/eventwebhook/eventwebhook.rb +50 -0
- data/lib/sendgrid/helpers/inbound/README.md +5 -5
- data/lib/sendgrid/helpers/inbound/app.rb +2 -2
- data/lib/sendgrid/helpers/inbound/public/index.html +1 -1
- data/lib/sendgrid/helpers/inbound/send.rb +3 -3
- data/lib/sendgrid/helpers/ip_management/ip_management.rb +1 -1
- data/lib/sendgrid/helpers/mail/README.md +3 -3
- data/lib/sendgrid/helpers/mail/asm.rb +6 -18
- data/lib/sendgrid/helpers/mail/attachment.rb +12 -42
- data/lib/sendgrid/helpers/mail/bcc_settings.rb +6 -18
- data/lib/sendgrid/helpers/mail/bypass_list_management.rb +8 -18
- data/lib/sendgrid/helpers/mail/category.rb +2 -2
- data/lib/sendgrid/helpers/mail/click_tracking.rb +6 -18
- data/lib/sendgrid/helpers/mail/content.rb +4 -3
- data/lib/sendgrid/helpers/mail/custom_arg.rb +6 -10
- data/lib/sendgrid/helpers/mail/email.rb +10 -5
- data/lib/sendgrid/helpers/mail/footer.rb +7 -27
- data/lib/sendgrid/helpers/mail/ganalytics.rb +10 -54
- data/lib/sendgrid/helpers/mail/header.rb +6 -10
- data/lib/sendgrid/helpers/mail/mail.rb +32 -48
- data/lib/sendgrid/helpers/mail/mail_settings.rb +9 -25
- data/lib/sendgrid/helpers/mail/open_tracking.rb +6 -18
- data/lib/sendgrid/helpers/mail/personalization.rb +40 -27
- data/lib/sendgrid/helpers/mail/section.rb +6 -10
- data/lib/sendgrid/helpers/mail/spam_check.rb +7 -27
- data/lib/sendgrid/helpers/mail/subscription_tracking.rb +8 -36
- data/lib/sendgrid/helpers/mail/substitution.rb +6 -10
- data/lib/sendgrid/helpers/mail/tracking_settings.rb +8 -20
- data/lib/sendgrid/helpers/permissions/scope.rb +2 -2
- data/lib/sendgrid/helpers/settings/README.md +2 -2
- data/lib/sendgrid/helpers/settings/settings.rb +1 -1
- data/lib/sendgrid/helpers/settings/tracking_settings_dto.rb +3 -5
- data/lib/sendgrid/helpers/stats/metrics.rb +5 -5
- data/lib/sendgrid/sendgrid.rb +4 -3
- data/lib/sendgrid/twilio_email.rb +1 -1
- data/lib/sendgrid/version.rb +1 -1
- data/lib/sendgrid-ruby.rb +2 -0
- data/mail_helper_v3.md +12 -12
- data/sendgrid-ruby.gemspec +8 -8
- data/spec/fixtures/event_webhook.rb +22 -0
- data/spec/rack/sendgrid_webhook_verification_spec.rb +142 -0
- data/spec/sendgrid/helpers/eventwebhook/eventwebhook_spec.rb +105 -0
- data/spec/sendgrid/helpers/settings/mail_settings_dto_spec.rb +3 -3
- data/spec/sendgrid/helpers/settings/partner_settings_dto_spec.rb +3 -3
- data/spec/sendgrid/helpers/settings/settings_spec.rb +2 -2
- data/spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb +3 -3
- data/spec/sendgrid/helpers/settings/user_settings_dto_spec.rb +3 -3
- data/spec/sendgrid/helpers/stats/email_stats_spec.rb +22 -23
- data/spec/sendgrid/helpers/stats/metrics_spec.rb +19 -20
- data/spec/sendgrid/helpers/stats/stats_response_spec.rb +22 -23
- data/spec/spec_helper.rb +3 -1
- data/static/img/github-fork.png +0 -0
- data/static/img/github-sign-up.png +0 -0
- data/test/sendgrid/helpers/mail/test_attachment.rb +4 -6
- data/test/sendgrid/helpers/mail/test_category.rb +0 -2
- data/test/sendgrid/helpers/mail/test_email.rb +17 -10
- data/test/sendgrid/helpers/mail/test_mail.rb +101 -102
- data/test/sendgrid/helpers/mail/test_personalizations.rb +145 -92
- data/test/sendgrid/permissions/test_scopes.rb +1 -3
- data/test/sendgrid/test_sendgrid-ruby.rb +1964 -1986
- data/twilio_sendgrid_logo.png +0 -0
- data/use-cases/README.md +17 -0
- data/use-cases/domain-authentication.md +5 -0
- data/use-cases/email-statistics.md +52 -0
- data/use-cases/legacy-templates.md +98 -0
- data/use-cases/personalizations.md +34 -0
- data/use-cases/sms.md +39 -0
- data/use-cases/transactional-templates.md +111 -0
- data/use-cases/twilio-email.md +13 -0
- data/use-cases/twilio-setup.md +54 -0
- metadata +69 -34
- data/.codeclimate.yml +0 -21
- data/.travis.yml +0 -40
- data/USE_CASES.md +0 -405
- data/docker/Dockerfile +0 -12
- data/docker/README.md +0 -30
- data/test/prism.sh +0 -42
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8e118713291ab6d133c75101195e33de03deb99d1e950cb55df8a266df10528d
|
|
4
|
+
data.tar.gz: e444657f217f6d84af54743baa09f145795f9424ac74a6852fc5a73435f18e75
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f2e41e61bc35633b62734361034a864fac34e6e6351122858d0dfefe9c98b9d7216bc91628d1c68ccc39c83a538e5f019de729102f648164382d8e01e1abed0c
|
|
7
|
+
data.tar.gz: 450c8ea54db164636cf3101080808248a9602689b17c9be9e3e93f138694019d72422d77d273ac1723077e97d12d7f0676ec479e62dfc434f82631e54f2049ab
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
contact_links:
|
|
2
|
+
- name: Twilio SendGrid Support
|
|
3
|
+
url: https://support.sendgrid.com
|
|
4
|
+
about: Get Support
|
|
5
|
+
- name: Stack Overflow
|
|
6
|
+
url: https://stackoverflow.com/questions/tagged/sendgrid-ruby+or+sendgrid+ruby
|
|
7
|
+
about: Ask questions on Stack Overflow
|
|
8
|
+
- name: Documentation
|
|
9
|
+
url: https://sendgrid.com/docs/for-developers/
|
|
10
|
+
about: View Reference Documentation
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
name: Test and Deploy
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [ '*' ]
|
|
5
|
+
tags: [ '*' ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
schedule:
|
|
9
|
+
# Run automatically at 8AM PST Monday-Friday
|
|
10
|
+
- cron: '0 15 * * 1-5'
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
name: Test
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
timeout-minutes: 20
|
|
18
|
+
strategy:
|
|
19
|
+
matrix:
|
|
20
|
+
ruby: [ '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', 'jruby-9.2' ]
|
|
21
|
+
env:
|
|
22
|
+
version: ${{ format('ruby:{0}', matrix.ruby) }}
|
|
23
|
+
DOCKER_LOGIN: ${{ secrets.DOCKER_USERNAME && secrets.DOCKER_AUTH_TOKEN }}
|
|
24
|
+
steps:
|
|
25
|
+
- name: Revise env version if necessary
|
|
26
|
+
run: echo "version=jruby:9.2" >> $GITHUB_ENV
|
|
27
|
+
if: ${{ matrix.ruby == 'jruby-9.2' }}
|
|
28
|
+
|
|
29
|
+
- name: Checkout sendgrid-ruby
|
|
30
|
+
uses: actions/checkout@v2
|
|
31
|
+
with:
|
|
32
|
+
fetch-depth: 0
|
|
33
|
+
|
|
34
|
+
- name: Login to Docker Hub
|
|
35
|
+
if: env.DOCKER_LOGIN
|
|
36
|
+
uses: docker/login-action@v1
|
|
37
|
+
with:
|
|
38
|
+
username: ${{ secrets.DOCKER_USERNAME }}
|
|
39
|
+
password: ${{ secrets.DOCKER_AUTH_TOKEN }}
|
|
40
|
+
|
|
41
|
+
- name: Set up Ruby
|
|
42
|
+
uses: ruby/setup-ruby@v1
|
|
43
|
+
with:
|
|
44
|
+
ruby-version: ${{ matrix.ruby }}
|
|
45
|
+
bundler-cache: true
|
|
46
|
+
|
|
47
|
+
- run: make install
|
|
48
|
+
|
|
49
|
+
- name: Set up linter
|
|
50
|
+
run: bundle add rubocop --version "~> 1.24.1" --group "development" --skip-install
|
|
51
|
+
if: ${{ matrix.ruby != '2.4' }}
|
|
52
|
+
|
|
53
|
+
- run: bundle install --with development
|
|
54
|
+
|
|
55
|
+
- name: Run linter
|
|
56
|
+
run: bundle exec rubocop
|
|
57
|
+
if: ${{ matrix.ruby != '2.4' }}
|
|
58
|
+
|
|
59
|
+
- name: Run tests
|
|
60
|
+
run: make test-docker
|
|
61
|
+
|
|
62
|
+
deploy:
|
|
63
|
+
name: Deploy
|
|
64
|
+
if: success() && github.ref_type == 'tag'
|
|
65
|
+
needs: [ test ]
|
|
66
|
+
runs-on: ubuntu-latest
|
|
67
|
+
steps:
|
|
68
|
+
- name: Checkout sendgrid-ruby
|
|
69
|
+
uses: actions/checkout@v2
|
|
70
|
+
with:
|
|
71
|
+
fetch-depth: 0
|
|
72
|
+
|
|
73
|
+
- name: Set up Ruby
|
|
74
|
+
uses: ruby/setup-ruby@v1
|
|
75
|
+
with:
|
|
76
|
+
ruby-version: 3.1
|
|
77
|
+
bundler-cache: true
|
|
78
|
+
|
|
79
|
+
- run: make install
|
|
80
|
+
|
|
81
|
+
- name: Create GitHub Release
|
|
82
|
+
uses: sendgrid/dx-automator/actions/release@main
|
|
83
|
+
with:
|
|
84
|
+
footer: '**[RubyGems](https://rubygems.org/gems/sendgrid-ruby/versions/${version})**'
|
|
85
|
+
env:
|
|
86
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
87
|
+
|
|
88
|
+
- name: Publish to Rubygems
|
|
89
|
+
env:
|
|
90
|
+
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
|
|
91
|
+
run: |
|
|
92
|
+
mkdir -p $HOME/.gem
|
|
93
|
+
touch $HOME/.gem/credentials
|
|
94
|
+
chmod 0600 $HOME/.gem/credentials
|
|
95
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
|
96
|
+
gem build *.gemspec
|
|
97
|
+
gem push *.gem
|
|
98
|
+
|
|
99
|
+
- name: Submit metric to Datadog
|
|
100
|
+
uses: sendgrid/dx-automator/actions/datadog-release-metric@main
|
|
101
|
+
env:
|
|
102
|
+
DD_API_KEY: ${{ secrets.DATADOG_API_KEY }}
|
|
103
|
+
|
|
104
|
+
notify-on-failure:
|
|
105
|
+
name: Slack notify on failure
|
|
106
|
+
if: failure() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag')
|
|
107
|
+
needs: [ test, deploy ]
|
|
108
|
+
runs-on: ubuntu-latest
|
|
109
|
+
steps:
|
|
110
|
+
- uses: rtCamp/action-slack-notify@v2
|
|
111
|
+
env:
|
|
112
|
+
SLACK_COLOR: failure
|
|
113
|
+
SLACK_ICON_EMOJI: ':github:'
|
|
114
|
+
SLACK_MESSAGE: ${{ format('Test *{0}*, Deploy *{1}*, {2}/{3}/actions/runs/{4}', needs.test.result, needs.deploy.result, github.server_url, github.repository, github.run_id) }}
|
|
115
|
+
SLACK_TITLE: Action Failure - ${{ github.repository }}
|
|
116
|
+
SLACK_USERNAME: GitHub Actions
|
|
117
|
+
SLACK_MSG_AUTHOR: twilio-dx
|
|
118
|
+
SLACK_FOOTER: Posted automatically using GitHub Actions
|
|
119
|
+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
|
120
|
+
MSG_MINIMAL: true
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
data/.rubocop_todo.yml
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# This configuration was generated by
|
|
2
|
+
# `rubocop --auto-gen-config`
|
|
3
|
+
# on 2022-01-25 23:45:43 UTC using RuboCop version 1.22.2.
|
|
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
|
+
# Cop supports --auto-correct.
|
|
11
|
+
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
|
|
12
|
+
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
|
|
13
|
+
Bundler/OrderedGems:
|
|
14
|
+
Exclude:
|
|
15
|
+
- 'Gemfile'
|
|
16
|
+
|
|
17
|
+
# Offense count: 1
|
|
18
|
+
# Configuration parameters: Include.
|
|
19
|
+
# Include: **/*.gemspec
|
|
20
|
+
Gemspec/RequiredRubyVersion:
|
|
21
|
+
Exclude:
|
|
22
|
+
- 'sendgrid-ruby.gemspec'
|
|
23
|
+
|
|
24
|
+
# Offense count: 1
|
|
25
|
+
# Cop supports --auto-correct.
|
|
26
|
+
# Configuration parameters: EnforcedStyle.
|
|
27
|
+
# SupportedStyles: final_newline, final_blank_line
|
|
28
|
+
Layout/TrailingEmptyLines:
|
|
29
|
+
Exclude:
|
|
30
|
+
- 'Gemfile'
|
|
31
|
+
|
|
32
|
+
# Offense count: 24
|
|
33
|
+
Lint/UselessAssignment:
|
|
34
|
+
Exclude:
|
|
35
|
+
- 'examples/scopes/scopes.rb'
|
|
36
|
+
- 'spec/rack/sendgrid_webhook_verification_spec.rb'
|
|
37
|
+
|
|
38
|
+
# Offense count: 10
|
|
39
|
+
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
|
|
40
|
+
Metrics/AbcSize:
|
|
41
|
+
Max: 134
|
|
42
|
+
|
|
43
|
+
# Offense count: 3
|
|
44
|
+
# Configuration parameters: CountComments, CountAsOne.
|
|
45
|
+
Metrics/ClassLength:
|
|
46
|
+
Max: 2018
|
|
47
|
+
|
|
48
|
+
# Offense count: 45
|
|
49
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
|
50
|
+
Metrics/MethodLength:
|
|
51
|
+
Max: 141
|
|
52
|
+
|
|
53
|
+
# Offense count: 4
|
|
54
|
+
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
|
|
55
|
+
Metrics/ParameterLists:
|
|
56
|
+
Max: 7
|
|
57
|
+
|
|
58
|
+
# Offense count: 4
|
|
59
|
+
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
|
60
|
+
# 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
|
|
61
|
+
Naming/FileName:
|
|
62
|
+
Exclude:
|
|
63
|
+
- 'gemfiles/Sinatra_1.gemfile'
|
|
64
|
+
- 'gemfiles/Sinatra_2.gemfile'
|
|
65
|
+
- 'lib/sendgrid-ruby.rb'
|
|
66
|
+
- 'test/sendgrid/test_sendgrid-ruby.rb'
|
|
67
|
+
|
|
68
|
+
# Offense count: 1
|
|
69
|
+
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
|
70
|
+
# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
|
|
71
|
+
Naming/MethodParameterName:
|
|
72
|
+
Exclude:
|
|
73
|
+
- 'lib/sendgrid/helpers/mail/personalization.rb'
|
|
74
|
+
|
|
75
|
+
# Offense count: 1
|
|
76
|
+
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
|
|
77
|
+
# NamePrefix: is_, has_, have_
|
|
78
|
+
# ForbiddenPrefixes: is_, has_, have_
|
|
79
|
+
# AllowedMethods: is_a?
|
|
80
|
+
# MethodDefinitionMacros: define_method, define_singleton_method
|
|
81
|
+
Naming/PredicateName:
|
|
82
|
+
Exclude:
|
|
83
|
+
- 'spec/**/*'
|
|
84
|
+
- 'examples/helpers/eventwebhook/example.rb'
|
|
85
|
+
|
|
86
|
+
# Offense count: 35
|
|
87
|
+
# Configuration parameters: AllowedConstants.
|
|
88
|
+
Style/Documentation:
|
|
89
|
+
Enabled: false
|
|
90
|
+
|
|
91
|
+
# Offense count: 3
|
|
92
|
+
# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, IgnoredMethods.
|
|
93
|
+
# SupportedStyles: annotated, template, unannotated
|
|
94
|
+
Style/FormatStringToken:
|
|
95
|
+
EnforcedStyle: unannotated
|
|
96
|
+
|
|
97
|
+
# Offense count: 97
|
|
98
|
+
# Cop supports --auto-correct.
|
|
99
|
+
# Configuration parameters: EnforcedStyle.
|
|
100
|
+
# SupportedStyles: always, always_true, never
|
|
101
|
+
Style/FrozenStringLiteralComment:
|
|
102
|
+
Enabled: false
|
|
103
|
+
|
|
104
|
+
# Offense count: 1
|
|
105
|
+
# Cop supports --auto-correct.
|
|
106
|
+
# Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
|
|
107
|
+
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
|
|
108
|
+
Style/HashSyntax:
|
|
109
|
+
Exclude:
|
|
110
|
+
- 'Gemfile'
|
|
111
|
+
|
|
112
|
+
# Offense count: 6
|
|
113
|
+
Style/MixinUsage:
|
|
114
|
+
Exclude:
|
|
115
|
+
- 'examples/helpers/eventwebhook/example.rb'
|
|
116
|
+
- 'examples/helpers/mail/example.rb'
|
|
117
|
+
- 'examples/helpers/settings/example.rb'
|
|
118
|
+
- 'examples/helpers/stats/example.rb'
|
|
119
|
+
- 'test/sendgrid/helpers/mail/test_attachment.rb'
|
|
120
|
+
- 'test/sendgrid/helpers/mail/test_mail.rb'
|
|
121
|
+
|
|
122
|
+
# Offense count: 54
|
|
123
|
+
# Cop supports --auto-correct.
|
|
124
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
|
125
|
+
# URISchemes: http, https
|
|
126
|
+
Layout/LineLength:
|
|
127
|
+
Max: 381
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,144 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
|
+
[2022-03-09] Version 6.6.2
|
|
5
|
+
--------------------------
|
|
6
|
+
**Library - Chore**
|
|
7
|
+
- [PR #483](https://github.com/sendgrid/sendgrid-ruby/pull/483): push Datadog Release Metric upon deploy success. Thanks to [@eshanholtz](https://github.com/eshanholtz)!
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
[2022-02-09] Version 6.6.1
|
|
11
|
+
--------------------------
|
|
12
|
+
**Library - Chore**
|
|
13
|
+
- [PR #482](https://github.com/sendgrid/sendgrid-ruby/pull/482): upgrade supported language versions. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
|
|
14
|
+
- [PR #480](https://github.com/sendgrid/sendgrid-ruby/pull/480): add gh release to workflow. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)!
|
|
15
|
+
- [PR #478](https://github.com/sendgrid/sendgrid-ruby/pull/478): migrate to gh actions. Thanks to [@beebzz](https://github.com/beebzz)!
|
|
16
|
+
|
|
17
|
+
**Library - Fix**
|
|
18
|
+
- [PR #479](https://github.com/sendgrid/sendgrid-ruby/pull/479): set version env var for tests. Thanks to [@beebzz](https://github.com/beebzz)!
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
[2021-11-03] Version 6.6.0
|
|
22
|
+
--------------------------
|
|
23
|
+
**Library - Feature**
|
|
24
|
+
- [PR #473](https://github.com/sendgrid/sendgrid-ruby/pull/473): update tests, use-cases, examples and implementation for From personalization. Thanks to [@beebzz](https://github.com/beebzz)!
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
[2021-10-18] Version 6.5.2
|
|
28
|
+
--------------------------
|
|
29
|
+
**Library - Docs**
|
|
30
|
+
- [PR #472](https://github.com/sendgrid/sendgrid-ruby/pull/472): improve signed webhook event validation docs. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)!
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
[2021-09-08] Version 6.5.1
|
|
34
|
+
--------------------------
|
|
35
|
+
**Library - Chore**
|
|
36
|
+
- [PR #470](https://github.com/sendgrid/sendgrid-ruby/pull/470): add support for ruby 3.0. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)!
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
[2021-08-11] Version 6.5.0
|
|
40
|
+
--------------------------
|
|
41
|
+
**Library - Feature**
|
|
42
|
+
- [PR #466](https://github.com/sendgrid/sendgrid-ruby/pull/466): Add From address to personalization. Thanks to [@grin](https://github.com/grin)!
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
[2021-02-10] Version 6.4.0
|
|
46
|
+
--------------------------
|
|
47
|
+
**Library - Feature**
|
|
48
|
+
- [PR #455](https://github.com/sendgrid/sendgrid-ruby/pull/455): Add http_options as a param in the SendGrid::API's constructor. Thanks to [@hoangtuanictvn](https://github.com/hoangtuanictvn)!
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
[2021-01-27] Version 6.3.9
|
|
52
|
+
--------------------------
|
|
53
|
+
**Library - Fix**
|
|
54
|
+
- [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)!
|
|
55
|
+
- [PR #457](https://github.com/sendgrid/sendgrid-ruby/pull/457): email is required. Thanks to [@luk4s](https://github.com/luk4s)!
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
[2020-12-16] Version 6.3.8
|
|
59
|
+
--------------------------
|
|
60
|
+
**Library - Fix**
|
|
61
|
+
- [PR #448](https://github.com/sendgrid/sendgrid-ruby/pull/448): tests failing on rubocop rule. Thanks to [@thinkingserious](https://github.com/thinkingserious)!
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
[2020-11-05] Version 6.3.7
|
|
65
|
+
--------------------------
|
|
66
|
+
**Library - Chore**
|
|
67
|
+
- [PR #447](https://github.com/sendgrid/sendgrid-ruby/pull/447): fix rubocop styling errors. Thanks to [@eshanholtz](https://github.com/eshanholtz)!
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
[2020-10-14] Version 6.3.6
|
|
71
|
+
--------------------------
|
|
72
|
+
**Library - Fix**
|
|
73
|
+
- [PR #440](https://github.com/sendgrid/sendgrid-ruby/pull/440): reading position of a request body. Thanks to [@snaka](https://github.com/snaka)!
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
[2020-09-28] Version 6.3.5
|
|
77
|
+
--------------------------
|
|
78
|
+
**Library - Fix**
|
|
79
|
+
- [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)!
|
|
80
|
+
|
|
81
|
+
**Library - Docs**
|
|
82
|
+
- [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)!
|
|
83
|
+
- [PR #332](https://github.com/sendgrid/sendgrid-ruby/pull/332): Add Email activity API Documentation. Thanks to [@dhoeric](https://github.com/dhoeric)!
|
|
84
|
+
|
|
85
|
+
**Library - Test**
|
|
86
|
+
- [PR #315](https://github.com/sendgrid/sendgrid-ruby/pull/315): Add rubocop check to CI. Thanks to [@dipil-saud](https://github.com/dipil-saud)!
|
|
87
|
+
|
|
88
|
+
**Library - Chore**
|
|
89
|
+
- [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)!
|
|
90
|
+
- [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)!
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
[2020-08-19] Version 6.3.4
|
|
94
|
+
--------------------------
|
|
95
|
+
**Library - Docs**
|
|
96
|
+
- [PR #319](https://github.com/sendgrid/sendgrid-ruby/pull/319): Run all the *.md files through grammar.ly service and update accordingly. Thanks to [@Sarthakagarwal22](https://github.com/Sarthakagarwal22)!
|
|
97
|
+
- [PR #344](https://github.com/sendgrid/sendgrid-ruby/pull/344): Update example.rb. Thanks to [@kylearoberts](https://github.com/kylearoberts)!
|
|
98
|
+
|
|
99
|
+
**Library - Chore**
|
|
100
|
+
- [PR #432](https://github.com/sendgrid/sendgrid-ruby/pull/432): update GitHub branch references to use HEAD. Thanks to [@thinkingserious](https://github.com/thinkingserious)!
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
[2020-07-22] Version 6.3.3
|
|
104
|
+
--------------------------
|
|
105
|
+
**Library - Chore**
|
|
106
|
+
- [PR #431](https://github.com/sendgrid/sendgrid-ruby/pull/431): migrate to new default sendgrid-oai branch. Thanks to [@eshanholtz](https://github.com/eshanholtz)!
|
|
107
|
+
- [PR #366](https://github.com/sendgrid/sendgrid-ruby/pull/366): add Rubocop configuration file. Thanks to [@RolandBurrows](https://github.com/RolandBurrows)!
|
|
108
|
+
|
|
109
|
+
**Library - Test**
|
|
110
|
+
- [PR #429](https://github.com/sendgrid/sendgrid-ruby/pull/429): fix the license test and actually run the test scripts. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
|
|
111
|
+
|
|
112
|
+
**Library - Docs**
|
|
113
|
+
- [PR #273](https://github.com/sendgrid/sendgrid-ruby/pull/273): Create a Use Cases Directory and Associated Files. Thanks to [@alanunruh](https://github.com/alanunruh)!
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
[2020-07-08] Version 6.3.2
|
|
117
|
+
--------------------------
|
|
118
|
+
**Library - Test**
|
|
119
|
+
- [PR #368](https://github.com/sendgrid/sendgrid-ruby/pull/368): add Simplecov Local Enhancements. Thanks to [@RolandBurrows](https://github.com/RolandBurrows)!
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
[2020-06-25] Version 6.3.1
|
|
123
|
+
--------------------------
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
[2020-06-24] Version 6.3.0
|
|
127
|
+
--------------------------
|
|
128
|
+
**Library - Feature**
|
|
129
|
+
- [PR #428](https://github.com/sendgrid/sendgrid-ruby/pull/428): adds rack middleware to make request verification easier in rack apps. Thanks to [@philnash](https://github.com/philnash)!
|
|
130
|
+
- [PR #425](https://github.com/sendgrid/sendgrid-ruby/pull/425): verify signature from event webhook. Thanks to [@eshanholtz](https://github.com/eshanholtz)!
|
|
131
|
+
|
|
132
|
+
**Library - Fix**
|
|
133
|
+
- [PR #427](https://github.com/sendgrid/sendgrid-ruby/pull/427): drop the starkbank dependency. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
[2020-05-13] Version 6.2.1
|
|
137
|
+
--------------------------
|
|
138
|
+
**Library - Fix**
|
|
139
|
+
- [PR #421](https://github.com/sendgrid/sendgrid-ruby/pull/421): migrate to common prism setup. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
|
|
140
|
+
|
|
141
|
+
|
|
4
142
|
[2020-04-29] Version 6.2.0
|
|
5
143
|
--------------------------
|
|
6
144
|
**Library - Feature**
|
|
@@ -81,7 +219,7 @@ All notable changes to this project will be documented in this file.
|
|
|
81
219
|
[2019-06-04] Version 6.0.0
|
|
82
220
|
--------------------------
|
|
83
221
|
### BREAKING CHANGE
|
|
84
|
-
- [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](
|
|
222
|
+
- [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](UPGRADE.md). Big thanks to [@jjb](https://github.com/jjb) for the PR!
|
|
85
223
|
|
|
86
224
|
### Added
|
|
87
225
|
- [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!
|
|
@@ -122,7 +260,7 @@ All notable changes to this project will be documented in this file.
|
|
|
122
260
|
|
|
123
261
|
## [5.2.0] - 2017-10-30 ##
|
|
124
262
|
### Added
|
|
125
|
-
- PR #234: Helpers for email statistics - global, category, subuser
|
|
263
|
+
- PR #234: Helpers for email statistics - global, category, subuser
|
|
126
264
|
- Thanks to [Awin Abi](https://github.com/awinabi) for the pull request!
|
|
127
265
|
|
|
128
266
|
## [5.1.0] - 2017-9-1 ##
|
|
@@ -148,7 +286,7 @@ All notable changes to this project will be documented in this file.
|
|
|
148
286
|
- `mail.headers` becomes `mail.add_header()`
|
|
149
287
|
- `mail.categories` becomes `mail.add_category()`
|
|
150
288
|
- `mail.custom_args` becomes `mail.custom_args()`
|
|
151
|
-
- For a full example of usage, please [see here](
|
|
289
|
+
- For a full example of usage, please [see here](examples/helpers/mail/example.rb#L21).
|
|
152
290
|
|
|
153
291
|
## [4.3.3] - 2017-5-2
|
|
154
292
|
### Update
|
|
@@ -159,7 +297,7 @@ All notable changes to this project will be documented in this file.
|
|
|
159
297
|
## [4.3.2] - 2017-5-1 ##
|
|
160
298
|
### Fixes
|
|
161
299
|
- #161: Fixed problematic Sinatra dependency
|
|
162
|
-
- 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.
|
|
300
|
+
- 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 the future, somewhat. Related issue: #159.
|
|
163
301
|
- Thanks to [Sebastian Skałacki](https://github.com/skalee) for the pull request!
|
|
164
302
|
|
|
165
303
|
## [4.3.1] - 2017-4-12 ##
|
|
@@ -171,7 +309,7 @@ All notable changes to this project will be documented in this file.
|
|
|
171
309
|
## [4.3.0] - 2017-4-12 ##
|
|
172
310
|
### Added
|
|
173
311
|
- #70: Adds an account settings management helper object
|
|
174
|
-
- See the [helper README](
|
|
312
|
+
- See the [helper README](lib/sendgrid/helpers/settings) for details
|
|
175
313
|
- Thanks to [Kyle Kern](https://github.com/kernkw) for the pull request!
|
|
176
314
|
|
|
177
315
|
## [4.2.1] - 2017-4-10 ##
|
|
@@ -181,8 +319,8 @@ All notable changes to this project will be documented in this file.
|
|
|
181
319
|
|
|
182
320
|
## [4.2.0] - 2017-4-10 ##
|
|
183
321
|
### Added
|
|
184
|
-
- #148: Set api_key to empty string
|
|
185
|
-
- This makes creating an API key for a SendGrid
|
|
322
|
+
- #148: Set api_key to an empty string
|
|
323
|
+
- This makes creating an API key for a SendGrid sub-user who does not have an API key easier. See #146 for details
|
|
186
324
|
- Thanks to [Adam Beck](https://github.com/Gwash3189) for the pull request!
|
|
187
325
|
|
|
188
326
|
## [4.1.1] - 2017-4-6 ##
|
|
@@ -223,7 +361,7 @@ All notable changes to this project will be documented in this file.
|
|
|
223
361
|
## [4.0.3] - 2016-08-24 ##
|
|
224
362
|
### Added
|
|
225
363
|
- Table of Contents in the README
|
|
226
|
-
- Added a [USE_CASES.md](
|
|
364
|
+
- Added a [USE_CASES.md](USE_CASES.md) section, with the first use case example for transactional templates
|
|
227
365
|
|
|
228
366
|
## [4.0.2] - 2016-07-26 ##
|
|
229
367
|
### Fixed
|
|
@@ -231,7 +369,7 @@ All notable changes to this project will be documented in this file.
|
|
|
231
369
|
|
|
232
370
|
## [4.0.1] - 2016-07-25 ##
|
|
233
371
|
### Added
|
|
234
|
-
- [Troubleshooting](
|
|
372
|
+
- [Troubleshooting](TROUBLESHOOTING.md) section
|
|
235
373
|
|
|
236
374
|
## [4.0.0] - 2016-07-23 ##
|
|
237
375
|
### BREAKING CHANGE
|
data/CONTRIBUTING.md
CHANGED
|
@@ -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>
|
|
@@ -42,12 +39,12 @@ A software bug is a demonstrable issue in the code base. In order for us to diag
|
|
|
42
39
|
Before you decide to create a new issue, please try the following:
|
|
43
40
|
|
|
44
41
|
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
|
|
42
|
+
2. Update to the latest version of this code and check if an issue has already been fixed
|
|
46
43
|
3. Copy and fill in the Bug Report Template we have provided below
|
|
47
44
|
|
|
48
45
|
### Please use our Bug Report Template
|
|
49
46
|
|
|
50
|
-
In order to make the process easier, we've included a [sample bug report template](
|
|
47
|
+
In order to make the process easier, we've included a [sample bug report template](ISSUE_TEMPLATE.md).
|
|
51
48
|
|
|
52
49
|
<a name="improvements-to-the-codebase"></a>
|
|
53
50
|
## Improvements to the Codebase
|
|
@@ -93,7 +90,7 @@ source ./sendgrid.env
|
|
|
93
90
|
|
|
94
91
|
##### Execute: #####
|
|
95
92
|
|
|
96
|
-
See the [examples folder](
|
|
93
|
+
See the [examples folder](examples) to get started quickly.
|
|
97
94
|
|
|
98
95
|
To run the examples using the local version of this library from the root directory of this repo, please replace:
|
|
99
96
|
|
|
@@ -124,20 +121,13 @@ Tests for the mail send and Web API v3 endpoints.
|
|
|
124
121
|
|
|
125
122
|
The Web API v3 client is `sendgrid-ruby.rb`
|
|
126
123
|
|
|
127
|
-
<a name="testing"></a>
|
|
128
124
|
## Testing
|
|
129
125
|
|
|
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.
|
|
126
|
+
All PRs require passing tests before the PR will be reviewed. All test files are in the [`tests`](test) directory. For the purposes of contributing to this repo, please update the [`test_sendgrid-ruby.rb`](test/sendgrid/test_sendgrid-ruby.rb) file with unit tests as you modify the code.
|
|
133
127
|
|
|
134
|
-
|
|
128
|
+
The integration tests require a Twilio SendGrid mock API in order to execute. We've simplified setting this up using Docker to run the tests. You will just need [Docker Desktop](https://docs.docker.com/get-docker/) and `make`.
|
|
135
129
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
rake
|
|
140
|
-
```
|
|
130
|
+
Once these are available, simply execute the Docker test target to run all tests: `make test-docker`. This command can also be used to open an interactive shell into the container where this library is installed. To start a *bash* shell for example, use this command: `command=bash make test-docker`.
|
|
141
131
|
|
|
142
132
|
<a name="style-guidelines-and-naming-conventions"></a>
|
|
143
133
|
## Style Guidelines & Naming Conventions
|
|
@@ -159,10 +149,10 @@ Please run your code through:
|
|
|
159
149
|
```bash
|
|
160
150
|
# Clone your fork of the repo into the current directory
|
|
161
151
|
git clone https://github.com/sendgrid/sendgrid-ruby
|
|
162
|
-
|
|
152
|
+
|
|
163
153
|
# Navigate to the newly cloned directory
|
|
164
154
|
cd sendgrid-ruby
|
|
165
|
-
|
|
155
|
+
|
|
166
156
|
# Assign the original repo to a remote called "upstream"
|
|
167
157
|
git remote add upstream https://github.com/sendgrid/sendgrid-ruby
|
|
168
158
|
```
|
|
@@ -183,7 +173,7 @@ Please run your code through:
|
|
|
183
173
|
|
|
184
174
|
4. Commit your changes in logical chunks. Please adhere to these [git commit
|
|
185
175
|
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
|
|
176
|
+
or your code is unlikely to be merged into the main project. Use Git's
|
|
187
177
|
[interactive rebase](https://help.github.com/articles/interactive-rebase)
|
|
188
178
|
feature to tidy up your commits before making them public.
|
|
189
179
|
|
|
@@ -194,7 +184,7 @@ Please run your code through:
|
|
|
194
184
|
5. Locally merge (or rebase) the upstream development branch into your topic branch:
|
|
195
185
|
|
|
196
186
|
```bash
|
|
197
|
-
git pull [--rebase] upstream
|
|
187
|
+
git pull [--rebase] upstream main
|
|
198
188
|
```
|
|
199
189
|
|
|
200
190
|
6. Push your topic branch up to your fork:
|
|
@@ -204,7 +194,7 @@ Please run your code through:
|
|
|
204
194
|
```
|
|
205
195
|
|
|
206
196
|
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
|
|
207
|
-
with a clear title and description against the `
|
|
197
|
+
with a clear title and description against the `main` branch. All tests must be passing before we will review the PR.
|
|
208
198
|
|
|
209
199
|
<a name="code-reviews"></a>
|
|
210
200
|
## Code Reviews
|
data/Dockerfile
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
ARG version=ruby:latest
|
|
2
|
+
FROM $version
|
|
3
|
+
|
|
4
|
+
# Needed for jruby
|
|
5
|
+
RUN apt-get update \
|
|
6
|
+
&& apt-get install -y make git
|
|
7
|
+
|
|
8
|
+
COPY prism/prism/nginx/cert.crt /usr/local/share/ca-certificates/cert.crt
|
|
9
|
+
RUN update-ca-certificates
|
|
10
|
+
|
|
11
|
+
WORKDIR /app
|
|
12
|
+
COPY . .
|
|
13
|
+
|
|
14
|
+
RUN make install
|