smtpapi 0.1.6 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/config.yml +10 -0
- data/.rubocop.yml +3 -4
- data/.travis.yml +10 -18
- data/CHANGELOG.md +27 -0
- data/CONTRIBUTING.md +7 -9
- data/FIRST_TIMERS.md +79 -0
- data/ISSUE_TEMPLATE.md +5 -1
- data/{LICENSE.md → LICENSE} +1 -1
- data/Makefile +1 -0
- data/PULL_REQUEST_TEMPLATE.md +5 -5
- data/README.md +12 -19
- data/TROUBLESHOOTING.md +1 -1
- data/USAGE.md +1 -1
- data/lib/smtpapi/version.rb +1 -1
- data/lib/smtpapi.rb +21 -23
- 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 +3 -3
- 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: 4717e99a6c7f243fea15f527521826473b383c7d71ad508986dd700d00dec3cd
|
4
|
+
data.tar.gz: 2afc59658d2068400fc46d2bfa07047bdd21d4a800299d5c640fe58ec80bbc8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44593b44a3e2d7120e1143944688a1f3d66fb9470342b595a1a1831be66595fcd6c1823f3164b34e6dd107a435f9a5578fe443af107f4bae87c9adfd5d357c86
|
7
|
+
data.tar.gz: b0d7391bf856f713efda0d3e9cc41bb4aab1e715dc4543c9c9c3edcf86abe0e380f07bc8ef5bb689aa7094e22bbcd22117ac1f13729e607069c7cd8aba40c792
|
@@ -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/smtpapi-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
|
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,35 +1,27 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
- jruby-9.2
|
3
|
+
- 2.7
|
4
|
+
- 2.6
|
5
|
+
- 2.5
|
6
|
+
- 2.4
|
7
|
+
- jruby-9.2
|
9
8
|
before_script:
|
10
|
-
|
9
|
+
- make install
|
11
10
|
script:
|
12
|
-
|
13
|
-
- rake test
|
14
|
-
matrix:
|
15
|
-
allow_failures:
|
16
|
-
- rvm: ruby-head
|
17
|
-
fast_finish: true
|
11
|
+
- make test
|
18
12
|
deploy:
|
19
13
|
provider: rubygems
|
20
|
-
api_key:
|
21
|
-
secure: PRNz0pPyO99KdYcQ1WKkunc3TOz1N5ZmdT997KlzRYa5uos+IFqr5UsztJzOrus5iWoQdKKtLGSRYe1SFnXDkSOwK61Q5YvYdSqF3OE/QD63qHub+is4CxmfMmXg+eBGreSH+kIWlSD8N3ic2CDZR8JoQmhPcit6zCZSN3WVRfY=
|
14
|
+
api_key: "$RUBYGEMS_API_KEY"
|
22
15
|
gem: smtpapi
|
23
16
|
on:
|
24
17
|
tags: true
|
25
18
|
rvm: '2.4'
|
26
19
|
skip_cleanup: true
|
27
|
-
|
28
20
|
notifications:
|
29
21
|
slack:
|
30
|
-
if: branch =
|
22
|
+
if: branch = main
|
31
23
|
on_pull_requests: false
|
32
24
|
on_success: never
|
33
25
|
on_failure: change
|
34
26
|
rooms:
|
35
|
-
|
27
|
+
secure: F5/iPScUfgbtjvfAOrU7gyptywZ2JvuC3Wil2I0eebmYTzcg5is0uDwViF1Qt1hQ5yQeKEtza8R7j+ug8MkANjWQOL3w5zMXBKL6UCHV1YLyDW47AAaELouz7yoTjZtu7VvbxPYGxk47eNCRlRfAMHl9VJd1SepXlrTQtwtOHVw=
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,33 @@ 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
|
+
[2022-01-12] Version 0.1.10
|
7
|
+
---------------------------
|
8
|
+
**Library - Chore**
|
9
|
+
- [PR #98](https://github.com/sendgrid/smtpapi-ruby/pull/98): update license year. Thanks to [@JenniferMah](https://github.com/JenniferMah)!
|
10
|
+
|
11
|
+
|
12
|
+
[2020-09-02] Version 0.1.9
|
13
|
+
--------------------------
|
14
|
+
**Library - Chore**
|
15
|
+
- [PR #71](https://github.com/sendgrid/smtpapi-ruby/pull/71): Conformance To Style Standards With RuboCop & TravisCI. Thanks to [@alanunruh](https://github.com/alanunruh)!
|
16
|
+
|
17
|
+
|
18
|
+
[2020-08-19] Version 0.1.8
|
19
|
+
--------------------------
|
20
|
+
**Library - Docs**
|
21
|
+
- [PR #72](https://github.com/sendgrid/smtpapi-ruby/pull/72): Update *.md files using Grammarly. Thanks to [@anatolyyyyyy](https://github.com/anatolyyyyyy)!
|
22
|
+
|
23
|
+
**Library - Chore**
|
24
|
+
- [PR #96](https://github.com/sendgrid/smtpapi-ruby/pull/96): update GitHub branch references to use HEAD. Thanks to [@thinkingserious](https://github.com/thinkingserious)!
|
25
|
+
|
26
|
+
|
27
|
+
[2020-08-05] Version 0.1.7
|
28
|
+
--------------------------
|
29
|
+
**Library - Chore**
|
30
|
+
- [PR #36](https://github.com/sendgrid/smtpapi-ruby/pull/36): fix CodeClimate suggestions. Thanks to [@valterbarros](https://github.com/valterbarros)!
|
31
|
+
|
32
|
+
|
6
33
|
[2020-07-22] Version 0.1.6
|
7
34
|
--------------------------
|
8
35
|
**Library - Docs**
|
data/CONTRIBUTING.md
CHANGED
@@ -1,4 +1,4 @@
|
|
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
3
|
- [Feature Request](#feature-request)
|
4
4
|
- [Submit a Bug Report](#submit-a-bug-report)
|
@@ -9,8 +9,6 @@ Hello! Thank you for choosing to help contribute to one of the SendGrid open sou
|
|
9
9
|
- [Creating a Pull Request](#creating-a-pull-request)
|
10
10
|
- [Code Reviews](#code-reviews)
|
11
11
|
|
12
|
-
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.
|
13
|
-
|
14
12
|
<a name="feature-request"></a>
|
15
13
|
## Feature Request
|
16
14
|
|
@@ -61,7 +59,7 @@ cd smtpapi-ruby
|
|
61
59
|
|
62
60
|
##### Execute: #####
|
63
61
|
|
64
|
-
See the [examples folder](
|
62
|
+
See the [examples folder](examples) to get started quickly.
|
65
63
|
|
66
64
|
To run the example:
|
67
65
|
|
@@ -89,9 +87,9 @@ Source code.
|
|
89
87
|
|
90
88
|
All PRs require passing tests before the PR will be reviewed.
|
91
89
|
|
92
|
-
All test files are in the [`test`](
|
90
|
+
All test files are in the [`test`](test) directory.
|
93
91
|
|
94
|
-
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.
|
95
93
|
|
96
94
|
To run the tests:
|
97
95
|
|
@@ -140,7 +138,7 @@ Please run your code through:
|
|
140
138
|
|
141
139
|
4. Commit your changes in logical chunks. Please adhere to these [git commit
|
142
140
|
message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
|
143
|
-
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
|
144
142
|
[interactive rebase](https://help.github.com/articles/interactive-rebase)
|
145
143
|
feature to tidy up your commits before making them public.
|
146
144
|
|
@@ -151,7 +149,7 @@ Please run your code through:
|
|
151
149
|
5. Locally merge (or rebase) the upstream development branch into your topic branch:
|
152
150
|
|
153
151
|
```bash
|
154
|
-
git pull [--rebase] upstream
|
152
|
+
git pull [--rebase] upstream main
|
155
153
|
```
|
156
154
|
|
157
155
|
6. Push your topic branch up to your fork:
|
@@ -161,7 +159,7 @@ Please run your code through:
|
|
161
159
|
```
|
162
160
|
|
163
161
|
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
|
164
|
-
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.
|
165
163
|
|
166
164
|
<a name="code-reviews"></a>
|
167
165
|
## Code Reviews
|
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 SMTPAPI Client](https://github.com/sendgrid/smtpapi-python/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
65
|
+
* [PHP SMTPAPI Client](https://github.com/sendgrid/smtpapi-php/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
66
|
+
* [C# SMTPAPI Client](https://github.com/sendgrid/smtpapi-csharp/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
67
|
+
* [Ruby SMTPAPI Client](https://github.com/sendgrid/smtpapi-ruby/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
68
|
+
* [Node.js SMTPAPI Client](https://github.com/sendgrid/smtpapi-nodejs/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
69
|
+
* [Java SMTPAPI Client](https://github.com/sendgrid/smtpapi-java/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
70
|
+
* [Go SMTPAPI Client](https://github.com/sendgrid/smtpapi-go/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3A%22difficulty%3A+easy%22+label%3A%22status%3A+help+wanted%22)
|
71
|
+
* [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/{LICENSE.md → LICENSE}
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
MIT License
|
2
2
|
|
3
|
-
Copyright (C)
|
3
|
+
Copyright (C) 2022, Twilio SendGrid, Inc. <help@twilio.com>
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
6
|
this software and associated documentation files (the "Software"), to deal in
|
data/Makefile
CHANGED
data/PULL_REQUEST_TEMPLATE.md
CHANGED
@@ -19,13 +19,13 @@ Closes #2
|
|
19
19
|
A short description of what this PR does.
|
20
20
|
|
21
21
|
### Checklist
|
22
|
-
- [
|
22
|
+
- [x] I acknowledge that all my contributions will be made under the project's license
|
23
23
|
- [ ] I have made a material change to the repo (functionality, testing, spelling, grammar)
|
24
|
-
- [ ] I have read the [Contribution Guidelines](CONTRIBUTING.md) and my PR follows them
|
24
|
+
- [ ] I have read the [Contribution Guidelines](https://github.com/sendgrid/smtpapi-ruby/blob/main/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
|
-
- [ ] I have added necessary documentation about the functionality in the appropriate .md file
|
28
|
+
- [ ] I have added the necessary documentation about the functionality in the appropriate .md file
|
29
29
|
- [ ] I have added inline documentation to the code I modified
|
30
30
|
|
31
|
-
If you have questions, please file a [support ticket](https://
|
31
|
+
If you have questions, please file a [support ticket](https://support.sendgrid.com), or create a GitHub Issue in this repository.
|
data/README.md
CHANGED
@@ -1,24 +1,22 @@
|
|
1
|
-
![SendGrid Logo](
|
1
|
+
![SendGrid Logo](twilio_sendgrid_logo.png)
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.
|
3
|
+
[![Build Status](https://travis-ci.com/sendgrid/smtpapi-ruby.svg?branch=main)](https://travis-ci.com/sendgrid/smtpapi-ruby)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/smtpapi.svg)](https://badge.fury.io/rb/smtpapi)
|
5
|
-
[![
|
6
|
-
[![Gem Version](https://badge.fury.io/rb/sendgrid-ruby.svg)](https://badge.fury.io/rb/sendgrid-ruby)
|
7
|
-
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.md)
|
5
|
+
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
|
8
6
|
[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
|
9
7
|
[![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/smtpapi-ruby.svg)](https://github.com/sendgrid/smtpapi-ruby/graphs/contributors)
|
10
8
|
|
11
9
|
**This ruby gem allows you to quickly and more easily generate SendGrid X-SMTPAPI headers.**
|
12
10
|
|
13
11
|
# Announcements
|
12
|
+
**The default branch name for this repository has been changed to `main` as of 07/27/2020.**
|
14
13
|
|
15
|
-
All updates to this library is documented in our [CHANGELOG](
|
14
|
+
All updates to this library is documented in our [CHANGELOG](CHANGELOG.md).
|
16
15
|
|
17
16
|
# Table of Contents
|
18
17
|
- [Installation](#installation)
|
19
18
|
- [Quick Start](#quick-start)
|
20
19
|
- [Usage](#usage)
|
21
|
-
- [Roadmap](#roadmap)
|
22
20
|
- [How to Contribute](#contribute)
|
23
21
|
- [About](#about)
|
24
22
|
- [License](#license)
|
@@ -76,24 +74,19 @@ print header.to_json
|
|
76
74
|
# Usage
|
77
75
|
|
78
76
|
- [SendGrid Docs](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html)
|
79
|
-
- [Example Code](
|
80
|
-
|
81
|
-
<a name="roadmap"></a>
|
82
|
-
# Roadmap
|
83
|
-
|
84
|
-
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.
|
77
|
+
- [Example Code](examples)
|
85
78
|
|
86
79
|
<a name="contribute"></a>
|
87
80
|
# How to Contribute
|
88
81
|
|
89
|
-
We encourage contribution to our libraries, please see our [CONTRIBUTING](
|
82
|
+
We encourage contribution to our libraries, please see our [CONTRIBUTING](CONTRIBUTING.md) guide for details.
|
90
83
|
|
91
84
|
Quick links:
|
92
85
|
|
93
|
-
- [Feature Request](
|
94
|
-
- [Bug Reports](
|
95
|
-
- [Improvements to the Codebase](
|
96
|
-
- [Review Pull Requests](
|
86
|
+
- [Feature Request](CONTRIBUTING.md#feature_request)
|
87
|
+
- [Bug Reports](CONTRIBUTING.md#submit_a_bug_report)
|
88
|
+
- [Improvements to the Codebase](CONTRIBUTING.md#improvements_to_the_codebase)
|
89
|
+
- [Review Pull Requests](CONTRIBUTING.md#code-reviews)
|
97
90
|
|
98
91
|
## Credits
|
99
92
|
|
@@ -111,4 +104,4 @@ If you've instead found a bug in the library or would like new features added, g
|
|
111
104
|
<a name="license"></a>
|
112
105
|
# License
|
113
106
|
|
114
|
-
[The MIT License (MIT)](LICENSE
|
107
|
+
[The MIT License (MIT)](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
CHANGED
data/lib/smtpapi/version.rb
CHANGED
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/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
@@ -7,7 +7,7 @@ require './lib/smtpapi'
|
|
7
7
|
#
|
8
8
|
class SmtpapiTest < Test::Unit::TestCase
|
9
9
|
def test_version
|
10
|
-
assert_equal('0.1.
|
10
|
+
assert_equal('0.1.10', Smtpapi::VERSION)
|
11
11
|
end
|
12
12
|
|
13
13
|
def test_empty
|
@@ -251,7 +251,7 @@ class SmtpapiTest < Test::Unit::TestCase
|
|
251
251
|
end
|
252
252
|
|
253
253
|
def test_license_exists
|
254
|
-
assert(File.file?('./LICENSE
|
254
|
+
assert(File.file?('./LICENSE'))
|
255
255
|
end
|
256
256
|
|
257
257
|
def test_pull_request_template_exists
|
@@ -275,7 +275,7 @@ class SmtpapiTest < Test::Unit::TestCase
|
|
275
275
|
# end
|
276
276
|
|
277
277
|
def test_license_date_is_updated
|
278
|
-
license_year = IO.read('LICENSE
|
278
|
+
license_year = IO.read('LICENSE').match(
|
279
279
|
/Copyright \(C\) (\d{4}), Twilio SendGrid/
|
280
280
|
)[1]
|
281
281
|
current_year = Time.new.year
|
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.10
|
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:
|
12
|
+
date: 2022-01-12 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
|
@@ -83,15 +83,17 @@ extra_rdoc_files: []
|
|
83
83
|
files:
|
84
84
|
- ".codeclimate.yml"
|
85
85
|
- ".env_sample"
|
86
|
+
- ".github/ISSUE_TEMPLATE/config.yml"
|
86
87
|
- ".gitignore"
|
87
88
|
- ".rubocop.yml"
|
88
89
|
- ".travis.yml"
|
89
90
|
- CHANGELOG.md
|
90
91
|
- CODE_OF_CONDUCT.md
|
91
92
|
- CONTRIBUTING.md
|
93
|
+
- FIRST_TIMERS.md
|
92
94
|
- Gemfile
|
93
95
|
- ISSUE_TEMPLATE.md
|
94
|
-
- LICENSE
|
96
|
+
- LICENSE
|
95
97
|
- Makefile
|
96
98
|
- PULL_REQUEST_TEMPLATE.md
|
97
99
|
- README.md
|
@@ -102,8 +104,11 @@ files:
|
|
102
104
|
- lib/smtpapi.rb
|
103
105
|
- lib/smtpapi/version.rb
|
104
106
|
- smtpapi.gemspec
|
107
|
+
- static/img/github-fork.png
|
108
|
+
- static/img/github-sign-up.png
|
105
109
|
- test/test.rb
|
106
110
|
- test/test_helper.rb
|
111
|
+
- twilio_sendgrid_logo.png
|
107
112
|
- use_cases/README.md
|
108
113
|
homepage: https://github.com/sendgrid/smtpapi-ruby
|
109
114
|
licenses:
|