smtpapi 0.1.4 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -4
- data/.travis.yml +17 -14
- data/CHANGELOG.md +34 -0
- data/CONTRIBUTING.md +13 -27
- data/FIRST_TIMERS.md +79 -0
- data/ISSUE_TEMPLATE.md +5 -1
- data/Makefile +1 -0
- data/PULL_REQUEST_TEMPLATE.md +1 -1
- data/README.md +15 -21
- data/TROUBLESHOOTING.md +1 -1
- data/USAGE.md +4 -0
- data/lib/smtpapi.rb +21 -23
- data/lib/smtpapi/version.rb +1 -1
- data/smtpapi.gemspec +3 -3
- data/static/img/github-fork.png +0 -0
- data/static/img/github-sign-up.png +0 -0
- data/test/test.rb +1 -1
- data/twilio_sendgrid_logo.png +0 -0
- metadata +12 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ea33650a2c95f7382b2803af80c12b1da1a20d33e11e8b118fb417687375c25
|
4
|
+
data.tar.gz: 5ec8b658a270602e58f7637e798f575cae607e1a5355b505e73f651923a0a403
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '02946689ed0272f288e96d3b38df12ed1dedda00b917aead376b3337cdcc90ebbd967a2735d67c8e7682b21aa42ad7e659f45ff8788e87a788e66b34db7c43b4'
|
7
|
+
data.tar.gz: a6aa16767d179f639dbfcce93e8b8bc0ade6c3c643d512456de1dfa47a8e4cd3b345b1d8c53e293621b303e72656b8956d35198bc511a69cf687732cf3b945f1
|
data/.rubocop.yml
CHANGED
@@ -16,10 +16,6 @@ ParameterLists:
|
|
16
16
|
AbcSize:
|
17
17
|
Max: 34
|
18
18
|
|
19
|
-
# Increase max number of "/" in %r
|
20
|
-
RegexpLiteral:
|
21
|
-
MaxSlashes: 0
|
22
|
-
|
23
19
|
# Increase the max line number of class
|
24
20
|
ClassLength:
|
25
21
|
Max: 250
|
@@ -30,3 +26,6 @@ CyclomaticComplexity:
|
|
30
26
|
|
31
27
|
PerceivedComplexity:
|
32
28
|
Max: 11
|
29
|
+
|
30
|
+
Metrics/LineLength:
|
31
|
+
Max: 100
|
data/.travis.yml
CHANGED
@@ -1,25 +1,28 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
-
|
4
|
-
- 2.6
|
5
|
-
- 2.5
|
6
|
-
- 2.4
|
7
|
-
- jruby
|
3
|
+
- 2.7
|
4
|
+
- 2.6
|
5
|
+
- 2.5
|
6
|
+
- 2.4
|
7
|
+
- jruby-9.2
|
8
8
|
before_script:
|
9
|
-
-
|
9
|
+
- make install
|
10
10
|
script:
|
11
|
-
-
|
12
|
-
- rake test
|
13
|
-
matrix:
|
14
|
-
allow_failures:
|
15
|
-
- rvm: ruby-head
|
16
|
-
fast_finish: true
|
11
|
+
- make test
|
17
12
|
deploy:
|
18
13
|
provider: rubygems
|
19
|
-
api_key:
|
20
|
-
secure: PRNz0pPyO99KdYcQ1WKkunc3TOz1N5ZmdT997KlzRYa5uos+IFqr5UsztJzOrus5iWoQdKKtLGSRYe1SFnXDkSOwK61Q5YvYdSqF3OE/QD63qHub+is4CxmfMmXg+eBGreSH+kIWlSD8N3ic2CDZR8JoQmhPcit6zCZSN3WVRfY=
|
14
|
+
api_key: $RUBYGEMS_API_KEY
|
21
15
|
gem: smtpapi
|
22
16
|
on:
|
23
17
|
tags: true
|
24
18
|
rvm: '2.4'
|
25
19
|
skip_cleanup: true
|
20
|
+
|
21
|
+
notifications:
|
22
|
+
slack:
|
23
|
+
if: branch = main
|
24
|
+
on_pull_requests: false
|
25
|
+
on_success: never
|
26
|
+
on_failure: change
|
27
|
+
rooms:
|
28
|
+
- secure: kyDurUDtXcp+6SfpFeszmzRZEpl2IOFqevGelhKVfx7j+M+p1wvPCkv9vnSdpKaZbQ80EKORxS4ZsnKUL9/yOP2uF9mrzB/DCfzFynw/IVfBejM8nkbf/CmosFh0SkkLuwotaPeqMhAtg1J8Avk1HVKJmihaJfkD6kzQ3PSyKlw=
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,40 @@ All notable changes to this project will be documented in this file.
|
|
3
3
|
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
+
[2020-09-02] Version 0.1.9
|
7
|
+
--------------------------
|
8
|
+
**Library - Chore**
|
9
|
+
- [PR #71](https://github.com/sendgrid/smtpapi-ruby/pull/71): Conformance To Style Standards With RuboCop & TravisCI. Thanks to [@alanunruh](https://github.com/alanunruh)!
|
10
|
+
|
11
|
+
|
12
|
+
[2020-08-19] Version 0.1.8
|
13
|
+
--------------------------
|
14
|
+
**Library - Docs**
|
15
|
+
- [PR #72](https://github.com/sendgrid/smtpapi-ruby/pull/72): Update *.md files using Grammarly. Thanks to [@anatolyyyyyy](https://github.com/anatolyyyyyy)!
|
16
|
+
|
17
|
+
**Library - Chore**
|
18
|
+
- [PR #96](https://github.com/sendgrid/smtpapi-ruby/pull/96): update GitHub branch references to use HEAD. Thanks to [@thinkingserious](https://github.com/thinkingserious)!
|
19
|
+
|
20
|
+
|
21
|
+
[2020-08-05] Version 0.1.7
|
22
|
+
--------------------------
|
23
|
+
**Library - Chore**
|
24
|
+
- [PR #36](https://github.com/sendgrid/smtpapi-ruby/pull/36): fix CodeClimate suggestions. Thanks to [@valterbarros](https://github.com/valterbarros)!
|
25
|
+
|
26
|
+
|
27
|
+
[2020-07-22] Version 0.1.6
|
28
|
+
--------------------------
|
29
|
+
**Library - Docs**
|
30
|
+
- [PR #82](https://github.com/sendgrid/smtpapi-ruby/pull/82): Create usage.md file. Thanks to [@prathamsharma92](https://github.com/prathamsharma92)!
|
31
|
+
- [PR #83](https://github.com/sendgrid/smtpapi-ruby/pull/83): add code review section in contributions. Thanks to [@prathamsharma92](https://github.com/prathamsharma92)!
|
32
|
+
|
33
|
+
|
34
|
+
[2020-03-04] Version 0.1.5
|
35
|
+
--------------------------
|
36
|
+
**Library - Chore**
|
37
|
+
- [PR #95](https://github.com/sendgrid/smtpapi-ruby/pull/95): add Ruby 2.7 to Travis. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
|
38
|
+
|
39
|
+
|
6
40
|
[2020-02-19] Version 0.1.4
|
7
41
|
--------------------------
|
8
42
|
**Library - Chore**
|
data/CONTRIBUTING.md
CHANGED
@@ -1,7 +1,5 @@
|
|
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.
|
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.
|
2
2
|
|
3
|
-
- [CLAs and CCLAs](#cla)
|
4
|
-
- [Roadmap & Milestones](#roadmap)
|
5
3
|
- [Feature Request](#feature-request)
|
6
4
|
- [Submit a Bug Report](#submit-a-bug-report)
|
7
5
|
- [Improvements to the Codebase](#improvements-to-the-codebase)
|
@@ -9,22 +7,7 @@ Hello! Thank you for choosing to help contribute to one of the SendGrid open sou
|
|
9
7
|
- [Testing](#testing)
|
10
8
|
- [Style Guidelines & Naming Conventions](#style-guidelines-and-naming-conventions)
|
11
9
|
- [Creating a Pull Request](#creating-a-pull-request)
|
12
|
-
|
13
|
-
<a name="roadmap"></a>
|
14
|
-
We use [Milestones](https://github.com/sendgrid/smtpapi-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.
|
15
|
-
|
16
|
-
<a name="cla"></a>
|
17
|
-
## CLAs and CCLAs
|
18
|
-
|
19
|
-
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.
|
20
|
-
|
21
|
-
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.
|
22
|
-
|
23
|
-
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).
|
24
|
-
|
25
|
-
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.
|
26
|
-
|
27
|
-
There are a few ways to contribute, which we'll enumerate below:
|
10
|
+
- [Code Reviews](#code-reviews)
|
28
11
|
|
29
12
|
<a name="feature-request"></a>
|
30
13
|
## Feature Request
|
@@ -51,7 +34,7 @@ Before you decide to create a new issue, please try the following:
|
|
51
34
|
|
52
35
|
### Please use our Bug Report Template
|
53
36
|
|
54
|
-
In order to make the process easier, we've included a [sample bug report template](
|
37
|
+
In order to make the process easier, we've included a [sample bug report template](ISSUE_TEMPLATE.md).
|
55
38
|
|
56
39
|
<a name="improvements-to-the-codebase"></a>
|
57
40
|
## Improvements to the Codebase
|
@@ -76,7 +59,7 @@ cd smtpapi-ruby
|
|
76
59
|
|
77
60
|
##### Execute: #####
|
78
61
|
|
79
|
-
See the [examples folder](
|
62
|
+
See the [examples folder](examples) to get started quickly.
|
80
63
|
|
81
64
|
To run the example:
|
82
65
|
|
@@ -104,9 +87,9 @@ Source code.
|
|
104
87
|
|
105
88
|
All PRs require passing tests before the PR will be reviewed.
|
106
89
|
|
107
|
-
All test files are in the [`test`](
|
90
|
+
All test files are in the [`test`](test) directory.
|
108
91
|
|
109
|
-
For the purposes of contributing to this repo, please update the [`test.rb`](
|
92
|
+
For the purposes of contributing to this repo, please update the [`test.rb`](test/test.rb) file with unit tests as you modify the code.
|
110
93
|
|
111
94
|
To run the tests:
|
112
95
|
|
@@ -155,7 +138,7 @@ Please run your code through:
|
|
155
138
|
|
156
139
|
4. Commit your changes in logical chunks. Please adhere to these [git commit
|
157
140
|
message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
|
158
|
-
or your code is unlikely be merged into the main project. Use Git's
|
141
|
+
or your code is unlikely to be merged into the main project. Use Git's
|
159
142
|
[interactive rebase](https://help.github.com/articles/interactive-rebase)
|
160
143
|
feature to tidy up your commits before making them public.
|
161
144
|
|
@@ -166,7 +149,7 @@ Please run your code through:
|
|
166
149
|
5. Locally merge (or rebase) the upstream development branch into your topic branch:
|
167
150
|
|
168
151
|
```bash
|
169
|
-
git pull [--rebase] upstream
|
152
|
+
git pull [--rebase] upstream main
|
170
153
|
```
|
171
154
|
|
172
155
|
6. Push your topic branch up to your fork:
|
@@ -176,6 +159,9 @@ Please run your code through:
|
|
176
159
|
```
|
177
160
|
|
178
161
|
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
|
179
|
-
with a clear title and description against the `
|
162
|
+
with a clear title and description against the `main` branch. All tests must be passing before we will review the PR.
|
163
|
+
|
164
|
+
<a name="code-reviews"></a>
|
165
|
+
## Code Reviews
|
180
166
|
|
181
|
-
If you
|
167
|
+
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 <a href="https://help.github.com/articles/about-pull-request-reviews/">information on how to review a Pull Request.</a>
|
data/FIRST_TIMERS.md
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
# How To Contribute to Twilio SendGrid Repositories via GitHub
|
2
|
+
Contributing to the Twilio SendGrid repositories is easy! All you need to do is find an open issue (see the bottom of this page for a list of repositories containing open issues), fix it and submit a pull request. Once you have submitted your pull request, the team can easily review it before it is merged into the repository.
|
3
|
+
|
4
|
+
To make a pull request, follow these steps:
|
5
|
+
|
6
|
+
1. Log into GitHub. If you do not already have a GitHub account, you will have to create one in order to submit a change. Click the Sign up link in the upper right-hand corner to create an account. Enter your username, password, and email address. If you are an employee of Twilio SendGrid, please use your full name with your GitHub account and enter Twilio SendGrid as your company so we can easily identify you.
|
7
|
+
|
8
|
+
<img src="/static/img/github-sign-up.png" width="800">
|
9
|
+
|
10
|
+
2. __[Fork](https://help.github.com/fork-a-repo/)__ the [smtpapi-php](https://github.com/sendgrid/smtpapi-php) repository:
|
11
|
+
|
12
|
+
<img src="/static/img/github-fork.png" width="800">
|
13
|
+
|
14
|
+
3. __Clone__ your fork via the following commands:
|
15
|
+
|
16
|
+
```bash
|
17
|
+
# Clone your fork of the repo into the current directory
|
18
|
+
git clone https://github.com/your_username/smtpapi-php
|
19
|
+
# Navigate to the newly cloned directory
|
20
|
+
cd smtpapi-php
|
21
|
+
# Assign the original repo to a remote called "upstream"
|
22
|
+
git remote add upstream https://github.com/sendgrid/smtpapi-php
|
23
|
+
```
|
24
|
+
|
25
|
+
> Don't forget to replace *your_username* in the URL by your real GitHub username.
|
26
|
+
|
27
|
+
4. __Create a new topic branch__ (off the main project development branch) to contain your feature, change, or fix:
|
28
|
+
|
29
|
+
```bash
|
30
|
+
git checkout -b <topic-branch-name>
|
31
|
+
```
|
32
|
+
|
33
|
+
5. __Commit your changes__ in logical chunks.
|
34
|
+
|
35
|
+
Please adhere to these [git commit message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) or your code is unlikely be merged into the main project. Use Git's [interactive rebase](https://help.github.com/articles/interactive-rebase) feature to tidy up your commits before making them public. Probably you will also have to create tests (if needed) or create or update the example code that demonstrates the functionality of this change to the code.
|
36
|
+
|
37
|
+
6. __Locally merge (or rebase)__ the upstream development branch into your topic branch:
|
38
|
+
|
39
|
+
```bash
|
40
|
+
git pull [--rebase] upstream main
|
41
|
+
```
|
42
|
+
|
43
|
+
7. __Push__ your topic branch up to your fork:
|
44
|
+
|
45
|
+
```bash
|
46
|
+
git push origin <topic-branch-name>
|
47
|
+
```
|
48
|
+
|
49
|
+
8. __[Open a Pull Request](https://help.github.com/articles/creating-a-pull-request/#changing-the-branch-range-and-destination-repository/)__ with a clear title and description against the `main` branch. All tests must be passing before we will review the PR.
|
50
|
+
|
51
|
+
## Important notice
|
52
|
+
|
53
|
+
Before creating a pull request, make sure that you respect the repository's constraints regarding contributions. You can find them in the [CONTRIBUTING.md](CONTRIBUTING.md) file.
|
54
|
+
|
55
|
+
## Repositories with Open, Easy, Help Wanted, Issue Filters
|
56
|
+
|
57
|
+
* [Python SDK](https://github.com/sendgrid/sendgrid-python/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
58
|
+
* [PHP SDK](https://github.com/sendgrid/sendgrid-php/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
59
|
+
* [C# SDK](https://github.com/sendgrid/sendgrid-csharp/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
60
|
+
* [Ruby SDK](https://github.com/sendgrid/sendgrid-ruby/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
61
|
+
* [Node.js SDK](https://github.com/sendgrid/sendgrid-nodejs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
62
|
+
* [Java SDK](https://github.com/sendgrid/sendgrid-java/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
63
|
+
* [Go SDK](https://github.com/sendgrid/sendgrid-go/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
64
|
+
* [Python STMPAPI Client](https://github.com/sendgrid/smtpapi-python/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
65
|
+
* [PHP STMPAPI Client](https://github.com/sendgrid/smtpapi-php/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
66
|
+
* [C# STMPAPI Client](https://github.com/sendgrid/smtpapi-csharp/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
67
|
+
* [Ruby STMPAPI Client](https://github.com/sendgrid/smtpapi-ruby/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
68
|
+
* [Node.js STMPAPI Client](https://github.com/sendgrid/smtpapi-nodejs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
69
|
+
* [Java STMPAPI Client](https://github.com/sendgrid/smtpapi-java/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
70
|
+
* [Go STMPAPI Client](https://github.com/sendgrid/smtpapi-go/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
71
|
+
* [Python HTTP Client](https://github.com/sendgrid/python-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
72
|
+
* [PHP HTTP Client](https://github.com/sendgrid/php-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
73
|
+
* [C# HTTP Client](https://github.com/sendgrid/csharp-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
74
|
+
* [Java HTTP Client](https://github.com/sendgrid/java-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
75
|
+
* [Ruby HTTP Client](https://github.com/sendgrid/ruby-http-client/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
76
|
+
* [Go HTTP Client](https://github.com/sendgrid/rest/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
77
|
+
* [Open API Definition](https://github.com/sendgrid/sendgrid-oai/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
78
|
+
* [DX Automator](https://github.com/sendgrid/dx-automator/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
79
|
+
* [Documentation](https://github.com/sendgrid/docs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
data/ISSUE_TEMPLATE.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
<!--
|
2
2
|
If this is a feature request, make sure you search Issues for an existing request before creating a new one!
|
3
|
+
|
4
|
+
Please utilize the template below to help us resolve your issue.
|
5
|
+
|
6
|
+
Note that many issues can be resolved by updating to the latest version.
|
3
7
|
-->
|
4
8
|
|
5
9
|
### Issue Summary
|
@@ -21,6 +25,6 @@ A summary of the issue and the environment in which it occurs. If suitable, incl
|
|
21
25
|
```
|
22
26
|
|
23
27
|
### Technical details:
|
24
|
-
* smtpapi-ruby version:
|
28
|
+
* smtpapi-ruby version:
|
25
29
|
* ruby version:
|
26
30
|
|
data/Makefile
CHANGED
data/PULL_REQUEST_TEMPLATE.md
CHANGED
@@ -23,7 +23,7 @@ A short description of what this PR does.
|
|
23
23
|
- [ ] I have made a material change to the repo (functionality, testing, spelling, grammar)
|
24
24
|
- [ ] I have read the [Contribution Guidelines](CONTRIBUTING.md) and my PR follows them
|
25
25
|
- [ ] I have titled the PR appropriately
|
26
|
-
- [ ] I have updated my branch with the
|
26
|
+
- [ ] I have updated my branch with the main branch
|
27
27
|
- [ ] I have added tests that prove my fix is effective or that my feature works
|
28
28
|
- [ ] I have added necessary documentation about the functionality in the appropriate .md file
|
29
29
|
- [ ] I have added inline documentation to the code I modified
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
![SendGrid Logo](
|
1
|
+
![SendGrid Logo](twilio_sendgrid_logo.png)
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/sendgrid/smtpapi-ruby.svg?branch=
|
3
|
+
[![Build Status](https://travis-ci.org/sendgrid/smtpapi-ruby.svg?branch=main)](https://travis-ci.org/SendGrid/smtpapi-ruby)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/smtpapi.svg)](https://badge.fury.io/rb/smtpapi)
|
5
5
|
[![Email Notifications Badge](https://dx.sendgrid.com/badge/ruby)](https://dx.sendgrid.com/newsletter/ruby)
|
6
6
|
[![Gem Version](https://badge.fury.io/rb/sendgrid-ruby.svg)](https://badge.fury.io/rb/sendgrid-ruby)
|
@@ -10,18 +10,15 @@
|
|
10
10
|
|
11
11
|
**This ruby gem allows you to quickly and more easily generate SendGrid X-SMTPAPI headers.**
|
12
12
|
|
13
|
-
|
14
13
|
# Announcements
|
14
|
+
**The default branch name for this repository has been changed to `main` as of 07/27/2020.**
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
All updates to this library is documented in our [CHANGELOG](https://github.com/sendgrid/smtpapi-ruby/blob/master/CHANGELOG.md).
|
16
|
+
All updates to this library is documented in our [CHANGELOG](CHANGELOG.md).
|
19
17
|
|
20
18
|
# Table of Contents
|
21
19
|
- [Installation](#installation)
|
22
20
|
- [Quick Start](#quick-start)
|
23
21
|
- [Usage](#usage)
|
24
|
-
- [Roadmap](#roadmap)
|
25
22
|
- [How to Contribute](#contribute)
|
26
23
|
- [About](#about)
|
27
24
|
- [License](#license)
|
@@ -31,7 +28,7 @@ All updates to this library is documented in our [CHANGELOG](https://github.com/
|
|
31
28
|
|
32
29
|
## Prerequisites
|
33
30
|
|
34
|
-
- Ruby version 2.
|
31
|
+
- Ruby version >= 2.4
|
35
32
|
- The SendGrid service, starting at the [free level](https://sendgrid.com/free?source=smtpapi-ruby)
|
36
33
|
|
37
34
|
## Install Package
|
@@ -79,24 +76,19 @@ print header.to_json
|
|
79
76
|
# Usage
|
80
77
|
|
81
78
|
- [SendGrid Docs](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html)
|
82
|
-
- [Example Code](
|
83
|
-
|
84
|
-
<a name="roadmap"></a>
|
85
|
-
# Roadmap
|
86
|
-
|
87
|
-
If you are interested in the future direction of this project, please take a look at our [milestones](https://github.com/sendgrid/smtpapi-ruby/milestones). We would love to hear your feedback.
|
79
|
+
- [Example Code](examples)
|
88
80
|
|
89
81
|
<a name="contribute"></a>
|
90
82
|
# How to Contribute
|
91
83
|
|
92
|
-
We encourage contribution to our libraries, please see our [CONTRIBUTING](
|
84
|
+
We encourage contribution to our libraries, please see our [CONTRIBUTING](CONTRIBUTING.md) guide for details.
|
93
85
|
|
94
86
|
Quick links:
|
95
87
|
|
96
|
-
- [Feature Request](
|
97
|
-
- [Bug Reports](
|
98
|
-
- [
|
99
|
-
- [
|
88
|
+
- [Feature Request](CONTRIBUTING.md#feature_request)
|
89
|
+
- [Bug Reports](CONTRIBUTING.md#submit_a_bug_report)
|
90
|
+
- [Improvements to the Codebase](CONTRIBUTING.md#improvements_to_the_codebase)
|
91
|
+
- [Review Pull Requests](CONTRIBUTING.md#code-reviews)
|
100
92
|
|
101
93
|
## Credits
|
102
94
|
|
@@ -105,9 +97,11 @@ This library was created by [Wataru Sato](https://github.com/awwa) and is now ma
|
|
105
97
|
<a name="about"></a>
|
106
98
|
# About
|
107
99
|
|
108
|
-
smtpapi-ruby is
|
100
|
+
smtpapi-ruby is maintained and funded by Twilio SendGrid, Inc. The names and logos for smtpapi-ruby are trademarks of Twilio SendGrid, Inc.
|
101
|
+
|
102
|
+
If you need help installing or using the library, please check the [Twilio SendGrid Support Help Center](https://support.sendgrid.com).
|
109
103
|
|
110
|
-
|
104
|
+
If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!
|
111
105
|
|
112
106
|
<a name="license"></a>
|
113
107
|
# License
|
data/TROUBLESHOOTING.md
CHANGED
@@ -8,7 +8,7 @@ If you can't find a solution below, please open an [issue](https://github.com/se
|
|
8
8
|
<a name="request-header"></a>
|
9
9
|
## Viewing the Request Header
|
10
10
|
|
11
|
-
When debugging or testing, it may be useful to
|
11
|
+
When debugging or testing, it may be useful to examine the raw request header to compare against the [documented format](https://sendgrid.com/docs/API_Reference/api_v3.html).
|
12
12
|
|
13
13
|
You can do this like so:
|
14
14
|
|
data/USAGE.md
ADDED
data/lib/smtpapi.rb
CHANGED
@@ -81,9 +81,7 @@ module Smtpapi
|
|
81
81
|
|
82
82
|
def add_filter(filter_name, parameter_name, parameter_value)
|
83
83
|
@filters[filter_name] = {} if @filters[filter_name].nil?
|
84
|
-
if @filters[filter_name]['settings'].nil?
|
85
|
-
@filters[filter_name]['settings'] = {}
|
86
|
-
end
|
84
|
+
@filters[filter_name]['settings'] = {} if @filters[filter_name]['settings'].nil?
|
87
85
|
@filters[filter_name]['settings'][parameter_name] = parameter_value
|
88
86
|
self
|
89
87
|
end
|
@@ -113,6 +111,26 @@ module Smtpapi
|
|
113
111
|
self
|
114
112
|
end
|
115
113
|
|
114
|
+
def json_string
|
115
|
+
escape_unicode(to_array.to_json)
|
116
|
+
end
|
117
|
+
alias_method :to_json, :json_string
|
118
|
+
|
119
|
+
def escape_unicode(str)
|
120
|
+
str.unpack('U*').map do |i|
|
121
|
+
if i > 65_535
|
122
|
+
"\\u#{format('%04x', ((i - 0x10000) / 0x400 + 0xD800))}" \
|
123
|
+
"\\u#{format('%04x', ((i - 0x10000) % 0x400 + 0xDC00))}"
|
124
|
+
elsif i > 127
|
125
|
+
"\\u#{format('%04x', i)}"
|
126
|
+
else
|
127
|
+
i.chr('UTF-8')
|
128
|
+
end
|
129
|
+
end.join
|
130
|
+
end
|
131
|
+
|
132
|
+
protected
|
133
|
+
|
116
134
|
def to_array
|
117
135
|
data = {}
|
118
136
|
data['to'] = @to unless @to.empty?
|
@@ -134,25 +152,5 @@ module Smtpapi
|
|
134
152
|
|
135
153
|
data
|
136
154
|
end
|
137
|
-
|
138
|
-
protected :to_array
|
139
|
-
|
140
|
-
def json_string
|
141
|
-
escape_unicode(to_array.to_json)
|
142
|
-
end
|
143
|
-
alias_method :to_json, :json_string
|
144
|
-
|
145
|
-
def escape_unicode(str)
|
146
|
-
str.unpack('U*').map do |i|
|
147
|
-
if i > 65_535
|
148
|
-
"\\u#{format('%04x', ((i - 0x10000) / 0x400 + 0xD800))}" \
|
149
|
-
"\\u#{format('%04x', ((i - 0x10000) % 0x400 + 0xDC00))}"
|
150
|
-
elsif i > 127
|
151
|
-
"\\u#{format('%04x', i)}"
|
152
|
-
else
|
153
|
-
i.chr('UTF-8')
|
154
|
-
end
|
155
|
-
end.join
|
156
|
-
end
|
157
155
|
end
|
158
156
|
end
|
data/lib/smtpapi/version.rb
CHANGED
data/smtpapi.gemspec
CHANGED
@@ -13,12 +13,12 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.license = 'MIT'
|
14
14
|
|
15
15
|
spec.files = `git ls-files -z`.split("\x0")
|
16
|
-
spec.executables = spec.files.grep(
|
17
|
-
spec.test_files = spec.files.grep(
|
16
|
+
spec.executables = spec.files.grep(/^bin/) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(/^(test|spec|features)/)
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
|
20
20
|
spec.add_development_dependency 'rake'
|
21
21
|
spec.add_development_dependency('rubocop', '>=0.29.0', '<0.30.0')
|
22
22
|
spec.add_development_dependency('test-unit', '~> 3.0')
|
23
|
-
spec.add_development_dependency
|
23
|
+
spec.add_development_dependency('simplecov', '~> 0.18.5')
|
24
24
|
end
|
Binary file
|
Binary file
|
data/test/test.rb
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smtpapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wataru Sato
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-02
|
12
|
+
date: 2020-09-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -63,16 +63,16 @@ dependencies:
|
|
63
63
|
name: simplecov
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 0.18.5
|
69
69
|
type: :development
|
70
70
|
prerelease: false
|
71
71
|
version_requirements: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 0.18.5
|
76
76
|
description: Smtpapi library for SendGrid.
|
77
77
|
email:
|
78
78
|
- awwa500@gmail.com
|
@@ -89,6 +89,7 @@ files:
|
|
89
89
|
- CHANGELOG.md
|
90
90
|
- CODE_OF_CONDUCT.md
|
91
91
|
- CONTRIBUTING.md
|
92
|
+
- FIRST_TIMERS.md
|
92
93
|
- Gemfile
|
93
94
|
- ISSUE_TEMPLATE.md
|
94
95
|
- LICENSE.md
|
@@ -97,12 +98,16 @@ files:
|
|
97
98
|
- README.md
|
98
99
|
- Rakefile
|
99
100
|
- TROUBLESHOOTING.md
|
101
|
+
- USAGE.md
|
100
102
|
- examples/example.rb
|
101
103
|
- lib/smtpapi.rb
|
102
104
|
- lib/smtpapi/version.rb
|
103
105
|
- smtpapi.gemspec
|
106
|
+
- static/img/github-fork.png
|
107
|
+
- static/img/github-sign-up.png
|
104
108
|
- test/test.rb
|
105
109
|
- test/test_helper.rb
|
110
|
+
- twilio_sendgrid_logo.png
|
106
111
|
- use_cases/README.md
|
107
112
|
homepage: https://github.com/sendgrid/smtpapi-ruby
|
108
113
|
licenses:
|
@@ -123,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
128
|
- !ruby/object:Gem::Version
|
124
129
|
version: '0'
|
125
130
|
requirements: []
|
126
|
-
rubygems_version: 3.0.
|
131
|
+
rubygems_version: 3.0.8
|
127
132
|
signing_key:
|
128
133
|
specification_version: 4
|
129
134
|
summary: Smtpapi library for SendGrid.
|