sendgrid-ruby 5.1.0 → 5.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.env_sample +1 -0
- data/.github/PULL_REQUEST_TEMPLATE +24 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +41 -0
- data/CONTRIBUTING.md +14 -13
- data/LICENSE.txt +1 -1
- data/README.md +9 -5
- data/TROUBLESHOOTING.md +21 -1
- data/USAGE.md +45 -46
- data/USE_CASES.md +33 -3
- data/examples/helpers/stats/example.rb +42 -0
- data/lib/sendgrid-ruby.rb +3 -0
- data/lib/sendgrid/helpers/mail/email.rb +11 -2
- data/lib/sendgrid/helpers/settings/README.md +2 -2
- data/lib/sendgrid/helpers/stats/email_stats.rb +46 -0
- data/lib/sendgrid/helpers/stats/metrics.rb +35 -0
- data/lib/sendgrid/helpers/stats/stats_response.rb +31 -0
- data/lib/sendgrid/version.rb +1 -1
- data/mail_helper_v3.md +38 -30
- data/spec/sendgrid/helpers/stats/email_stats_spec.rb +112 -0
- data/spec/sendgrid/helpers/stats/metrics_spec.rb +46 -0
- data/spec/sendgrid/helpers/stats/stats_response_spec.rb +76 -0
- data/test/sendgrid/helpers/mail/test_email.rb +34 -0
- data/test/sendgrid/test_sendgrid-ruby.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc03ba685c99e58e6b186a588a8568c04b9800bb
|
4
|
+
data.tar.gz: 8287e74b24b8a63daade480fe4e8f9499486d04c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c357990d74833e50714fa327abf456c701384c70604893bac9add0692441cc200c2b28e2d451b62fdc08c9f5d2bdebe09565760874582a8a7b549f82e7b2e49b
|
7
|
+
data.tar.gz: 6d6bf54a2cdd4847a0eca57ed5e1b34b0231040afa34dbf423f66858fa3053d4cd3de8ed9b061aea86644c154bf5668e2077d37b0451e1e480704da6071f2bf3
|
data/.env_sample
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export SENDGRID_API_KEY=''
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<!--
|
2
|
+
We appreciate the effort for this pull request but before that please make sure you read the contribution guidelines given above, then fill out the blanks below.
|
3
|
+
|
4
|
+
|
5
|
+
Please enter each Issue number you are resolving in your PR after one of the following words [Fixes, Closes, Resolves]. This will auto-link these issues and close them when this PR is merged!
|
6
|
+
e.g.
|
7
|
+
Fixes #1
|
8
|
+
Closes #2
|
9
|
+
-->
|
10
|
+
# Fixes #
|
11
|
+
|
12
|
+
### Checklist
|
13
|
+
- [ ] I have made a material change to the repo (functionality, testing, spelling, grammar)
|
14
|
+
- [ ] I have read the [Contribution Guide] and my PR follows them.
|
15
|
+
- [ ] I updated my branch with the master branch.
|
16
|
+
- [ ] I have added tests that prove my fix is effective or that my feature works
|
17
|
+
- [ ] I have added necessary documentation about the functionality in the appropriate .md file
|
18
|
+
- [ ] I have added in line documentation to the code I modified
|
19
|
+
|
20
|
+
### Short description of what this PR does:
|
21
|
+
-
|
22
|
+
-
|
23
|
+
|
24
|
+
If you have questions, please send an email to [Sendgrid](mailto:dx@sendgrid.com), or file a Github Issue in this repository.
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## [5.2.0] - 2017-10-30 ##
|
5
|
+
### Added
|
6
|
+
- PR #234: Helpers for email statistics - global, category, subuser
|
7
|
+
- Thanks to [Awin Abi](https://github.com/awinabi) for the pull request!
|
8
|
+
|
4
9
|
## [5.1.0] - 2017-9-1 ##
|
5
10
|
### Added
|
6
11
|
- #173: Update ruby-http-client dependency
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# SendGrid Community Code of Conduct
|
2
|
+
|
3
|
+
The SendGrid open source community is made up of members from around the globe with a diverse set of skills, personalities, and experiences. It is through these differences that our community experiences successes and continued growth. When you're working with members of the community, we encourage you to follow these guidelines, which help steer our interactions and strive to maintain a positive, successful and growing community.
|
4
|
+
|
5
|
+
### Be Open
|
6
|
+
Members of the community are open to collaboration, whether it's on pull requests, code reviews, approvals, issues or otherwise. We're receptive to constructive comments and criticism, as the experiences and skill sets of all members contribute to the whole of our efforts. We're accepting of all who wish to take part in our activities, fostering an environment where anyone can participate, and everyone can make a difference.
|
7
|
+
|
8
|
+
### Be Considerate
|
9
|
+
Members of the community are considerate of their peers, which include other contributors and users of SendGrid. We're thoughtful when addressing the efforts of others, keeping in mind that often the labor was completed with the intent of the good of the community. We're attentive in our communications, whether in person or online, and we're tactful when approaching differing views.
|
10
|
+
|
11
|
+
### Be Respectful
|
12
|
+
Members of the community are respectful. We're respectful of others, their positions, their skills, their commitments and their efforts. We're respectful of the volunteer efforts that permeate the SendGrid community. We're respectful of the processes outlined in the community, and we work within them. When we disagree, we are courteous in raising our issues. Overall, we're good to each other. We contribute to this community not because we have to, but because we want to. If we remember that, these guidelines will come naturally.
|
13
|
+
|
14
|
+
## Additional Guidance
|
15
|
+
|
16
|
+
### Disclose Potential Conflicts of Interest
|
17
|
+
Community discussions often involve interested parties. We expect participants to be aware when they are conflicted due to employment or other projects they are involved in and disclose those interests to other project members. When in doubt, over-disclose. Perceived conflicts of interest are important to address so that the community’s decisions are credible even when unpopular, difficult or favorable to the interests of one group over another.
|
18
|
+
|
19
|
+
### Interpretation
|
20
|
+
This Code is not exhaustive or complete. It is not a rulebook; it serves to distill our common understanding of a collaborative, shared environment and goals. We expect it to be followed in spirit as much as in the letter. When in doubt, try to abide by [SendGrid’s cultural values](https://sendgrid.com/blog/employee-engagement-the-4h-way) defined by our “4H’s”: Happy, Hungry, Humble and Honest.
|
21
|
+
|
22
|
+
### Enforcement
|
23
|
+
Most members of the SendGrid community always comply with this Code, not because of the existence of this Code, but because they have long experience participating in open source communities where the conduct described above is normal and expected. However, failure to observe this Code may be grounds for suspension, reporting the user for abuse or changing permissions for outside contributors.
|
24
|
+
|
25
|
+
## If you have concerns about someone’s conduct
|
26
|
+
**Initiate Direct Contact** - It is always appropriate to email a community member (if contact information is available), mention that you think their behavior was out of line, and (if necessary) point them to this Code.
|
27
|
+
|
28
|
+
**Discuss Publicly** - Discussing publicly is always acceptable. Note, though, that approaching the person directly may be better, as it tends to make them less defensive, and it respects the time of other community members, so you probably want to try direct contact first.
|
29
|
+
|
30
|
+
**Contact the Moderators** - You can reach the SendGrid moderators by emailing dx@sendgrid.com.
|
31
|
+
|
32
|
+
## Submission to SendGrid Repositories
|
33
|
+
Finally, just a reminder, changes to the SendGrid repositories will only be accepted upon completion of the [SendGrid Contributor Agreement](https://cla.sendgrid.com).
|
34
|
+
|
35
|
+
## Attribution
|
36
|
+
|
37
|
+
SendGrid thanks the following, on which it draws for content and inspiration:
|
38
|
+
|
39
|
+
* [Python Community Code of Conduct](https://www.python.org/psf/codeofconduct/)
|
40
|
+
* [Open Source Initiative General Code of Conduct](https://opensource.org/codeofconduct)
|
41
|
+
* [Apache Code of Conduct](https://www.apache.org/foundation/policies/conduct.html)
|
data/CONTRIBUTING.md
CHANGED
@@ -2,13 +2,13 @@ Hello! Thank you for choosing to help contribute to one of the SendGrid open sou
|
|
2
2
|
|
3
3
|
- [CLAs and CCLAs](#cla)
|
4
4
|
- [Roadmap & Milestones](#roadmap)
|
5
|
-
- [Feature Request](#
|
6
|
-
- [Submit a Bug Report](#
|
7
|
-
- [Improvements to the Codebase](#
|
8
|
-
- [Understanding the Code Base](#
|
5
|
+
- [Feature Request](#feature-request)
|
6
|
+
- [Submit a Bug Report](#submit-a-bug-report)
|
7
|
+
- [Improvements to the Codebase](#improvements-to-the-codebase)
|
8
|
+
- [Understanding the Code Base](#understanding-the-codebase)
|
9
9
|
- [Testing](#testing)
|
10
|
-
- [Style Guidelines & Naming Conventions](#
|
11
|
-
- [Creating a Pull Request](#
|
10
|
+
- [Style Guidelines & Naming Conventions](#style-guidelines-and-naming-conventions)
|
11
|
+
- [Creating a Pull Request](#creating-a-pull-request)
|
12
12
|
|
13
13
|
<a name="roadmap"></a>
|
14
14
|
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.
|
@@ -26,7 +26,7 @@ When you create a Pull Request, after a few seconds, a comment will appear with
|
|
26
26
|
|
27
27
|
There are a few ways to contribute, which we'll enumerate below:
|
28
28
|
|
29
|
-
<a name="
|
29
|
+
<a name="feature-request"></a>
|
30
30
|
## Feature Request
|
31
31
|
|
32
32
|
If you'd like to make a feature request, please read this section.
|
@@ -36,7 +36,7 @@ The GitHub issue tracker is the preferred channel for library feature requests,
|
|
36
36
|
- Please **search for existing issues** in order to ensure we don't have duplicate bugs/feature requests.
|
37
37
|
- Please be respectful and considerate of others when commenting on issues
|
38
38
|
|
39
|
-
<a name="
|
39
|
+
<a name="submit-a-bug-report"></a>
|
40
40
|
## Submit a Bug Report
|
41
41
|
|
42
42
|
Note: DO NOT include your credentials in ANY code examples, descriptions, or media you make public.
|
@@ -53,7 +53,7 @@ Before you decide to create a new issue, please try the following:
|
|
53
53
|
|
54
54
|
In order to make the process easier, we've included a [sample bug report template](https://github.com/sendgrid/sendgrid-ruby/.github/ISSUE_TEMPLATE) (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting.
|
55
55
|
|
56
|
-
<a name="
|
56
|
+
<a name="improvements-to-the-codebase"></a>
|
57
57
|
## Improvements to the Codebase
|
58
58
|
|
59
59
|
We welcome direct contributions to the sendgrid-ruby code base. Thank you!
|
@@ -113,7 +113,7 @@ Then run using:
|
|
113
113
|
ruby example.rb
|
114
114
|
```
|
115
115
|
|
116
|
-
<a name="
|
116
|
+
<a name="understanding-the-codebase"></a>
|
117
117
|
## Understanding the Code Base
|
118
118
|
|
119
119
|
**/examples**
|
@@ -143,7 +143,7 @@ To run the tests:
|
|
143
143
|
rake
|
144
144
|
```
|
145
145
|
|
146
|
-
<a name="
|
146
|
+
<a name="style-guidelines-and-naming-conventions"></a>
|
147
147
|
## Style Guidelines & Naming Conventions
|
148
148
|
|
149
149
|
Generally, we follow the style guidelines as suggested by the official language. However, we ask that you conform to the styles that already exist in the library. If you wish to deviate, please explain your reasoning.
|
@@ -154,7 +154,8 @@ Please run your code through:
|
|
154
154
|
|
155
155
|
- [rubocop](https://github.com/bbatsov/rubocop).
|
156
156
|
|
157
|
-
|
157
|
+
<a name="creating-a-pull-request"></a>
|
158
|
+
## Creating a Pull Request
|
158
159
|
|
159
160
|
1. [Fork](https://help.github.com/fork-a-repo/) the project, clone your fork,
|
160
161
|
and configure the remotes:
|
@@ -163,7 +164,7 @@ Please run your code through:
|
|
163
164
|
# Clone your fork of the repo into the current directory
|
164
165
|
git clone https://github.com/sendgrid/sendgrid-ruby
|
165
166
|
# Navigate to the newly cloned directory
|
166
|
-
cd sendgrid-
|
167
|
+
cd sendgrid-ruby
|
167
168
|
# Assign the original repo to a remote called "upstream"
|
168
169
|
git remote add upstream https://github.com/sendgrid/sendgrid-ruby
|
169
170
|
```
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
![SendGrid Logo](https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png)
|
2
|
+
|
3
|
+
[![Travis Badge](https://travis-ci.org/sendgrid/sendgrid-ruby.svg?branch=master)](https://travis-ci.org/sendgrid/sendgrid-ruby) [![Gem Version](https://badge.fury.io/rb/sendgrid-ruby.svg)](https://badge.fury.io/rb/sendgrid-ruby)[![Email Notifications Badge](https://dx.sendgrid.com/badge/ruby)](https://dx.sendgrid.com/newsletter/ruby)[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt)[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)[![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/sendgrid-ruby.svg)](https://github.com/sendgrid/sendgrid-ruby/graphs/contributors)
|
3
4
|
|
4
5
|
**NEW:** Subscribe to email [notifications](https://dx.sendgrid.com/newsletter/ruby) for releases and breaking changes.
|
5
6
|
|
@@ -16,7 +17,7 @@ We appreciate your continued support, thank you!
|
|
16
17
|
# Table of Contents
|
17
18
|
|
18
19
|
* [Installation](#installation)
|
19
|
-
* [Quick Start](#
|
20
|
+
* [Quick Start](#quick-start)
|
20
21
|
* [Processing Inbound Email](#inbound)
|
21
22
|
* [Usage](#usage)
|
22
23
|
* [Use Cases](#use_cases)
|
@@ -25,6 +26,7 @@ We appreciate your continued support, thank you!
|
|
25
26
|
* [How to Contribute](#contribute)
|
26
27
|
* [Troubleshooting](#troubleshooting)
|
27
28
|
* [About](#about)
|
29
|
+
* [License](#license)
|
28
30
|
|
29
31
|
<a name="installation"></a>
|
30
32
|
# Installation
|
@@ -68,7 +70,7 @@ gem install sendgrid-ruby
|
|
68
70
|
- [Ruby-HTTP-Client](https://github.com/sendgrid/ruby-http-client)
|
69
71
|
- [Sinatra](http://www.sinatrarb.com/) - this is only needed if you plan to process [Inbound Email](#inbound).
|
70
72
|
|
71
|
-
<a name="
|
73
|
+
<a name="quick-start"></a>
|
72
74
|
# Quick Start
|
73
75
|
|
74
76
|
## Hello Email
|
@@ -208,4 +210,6 @@ sendgrid-ruby is guided and supported by the SendGrid [Developer Experience Team
|
|
208
210
|
|
209
211
|
sendgrid-ruby is maintained and funded by SendGrid, Inc. The names and logos for sendgrid-ruby are trademarks of SendGrid, Inc.
|
210
212
|
|
211
|
-
|
213
|
+
<a name="license"></a>
|
214
|
+
# License
|
215
|
+
[The MIT License (MIT)](LICENSE.txt)
|
data/TROUBLESHOOTING.md
CHANGED
@@ -12,6 +12,8 @@ If you can't find a solution below, please open an [issue](https://github.com/se
|
|
12
12
|
* [Versions](#versions)
|
13
13
|
* [Environment Variables and Your SendGrid API Key](#environment)
|
14
14
|
* [Using the Package Manager](#package-manager)
|
15
|
+
* [Rails Specifics](#rails-specifics)
|
16
|
+
* [Viewing the Request Body](#request-body)
|
15
17
|
|
16
18
|
<a name="migrating"></a>
|
17
19
|
## Migrating from v2 to v3
|
@@ -68,7 +70,7 @@ end
|
|
68
70
|
<a name="versions"></a>
|
69
71
|
## Versions
|
70
72
|
|
71
|
-
We follow the MAJOR.MINOR.PATCH versioning scheme as described by [SemVer.org](http://semver.org). Therefore, we recommend that you always pin (or vendor) the particular version you are working with to your code and never auto-update to the latest version. Especially when there is a MAJOR point release, since that is
|
73
|
+
We follow the MAJOR.MINOR.PATCH versioning scheme as described by [SemVer.org](http://semver.org). Therefore, we recommend that you always pin (or vendor) the particular version you are working with to your code and never auto-update to the latest version. Especially when there is a MAJOR point release, since that is guaranteed to be a breaking change. Changes are documented in the [CHANGELOG](https://github.com/sendgrid/sendgrid-ruby/blob/master/CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-ruby/releases) section.
|
72
74
|
|
73
75
|
<a name="environment"></a>
|
74
76
|
## Environment Variables and Your SendGrid API Key
|
@@ -109,3 +111,21 @@ Or install it yourself using:
|
|
109
111
|
```bash
|
110
112
|
gem install sendgrid-ruby -v X.X.X
|
111
113
|
```
|
114
|
+
|
115
|
+
<a name="rails-specifics"></a>
|
116
|
+
## Rails Specifics
|
117
|
+
|
118
|
+
- Namespace collision between Rails own `Mail` class and sendgrid class `Mail`. To avoid that issues please use `SendGrid::Mail` instead.
|
119
|
+
|
120
|
+
- Possibility of a namespace collision between the sendgrid class `Email` and your own defined `Email` class. To avoid these issues, you can skip the `include SendGrid` line and use the `SendGrid::` prefix for Email. Please see this [SO answer](https://stackoverflow.com/questions/41508464/rails-model-name-conflict-with-included-gem?noredirect=1#comment70223099_41508464) for specifics.
|
121
|
+
|
122
|
+
<a name="request-body"></a>
|
123
|
+
## Viewing the Request Body
|
124
|
+
|
125
|
+
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).
|
126
|
+
|
127
|
+
You can do this before `response = sg.client.mail._('send').post(request_body: mail.to_json)` like so:
|
128
|
+
|
129
|
+
```ruby
|
130
|
+
puts mail
|
131
|
+
```
|
data/USAGE.md
CHANGED
@@ -11,9 +11,9 @@ sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
|
|
11
11
|
|
12
12
|
# Table of Contents
|
13
13
|
|
14
|
-
* [ACCESS SETTINGS](#
|
14
|
+
* [ACCESS SETTINGS](#access-settings)
|
15
15
|
* [ALERTS](#alerts)
|
16
|
-
* [API KEYS](#
|
16
|
+
* [API KEYS](#api-keys)
|
17
17
|
* [ASM](#asm)
|
18
18
|
* [BROWSERS](#browsers)
|
19
19
|
* [CAMPAIGNS](#campaigns)
|
@@ -24,21 +24,21 @@ sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
|
|
24
24
|
* [GEO](#geo)
|
25
25
|
* [IPS](#ips)
|
26
26
|
* [MAIL](#mail)
|
27
|
-
* [MAIL SETTINGS](#
|
28
|
-
* [MAILBOX PROVIDERS](#
|
29
|
-
* [PARTNER SETTINGS](#
|
27
|
+
* [MAIL SETTINGS](#mail-settings)
|
28
|
+
* [MAILBOX PROVIDERS](#mailbox-providers)
|
29
|
+
* [PARTNER SETTINGS](#partner-settings)
|
30
30
|
* [SCOPES](#scopes)
|
31
31
|
* [SENDERS](#senders)
|
32
32
|
* [STATS](#stats)
|
33
33
|
* [SUBUSERS](#subusers)
|
34
34
|
* [SUPPRESSION](#suppression)
|
35
35
|
* [TEMPLATES](#templates)
|
36
|
-
* [TRACKING SETTINGS](#
|
36
|
+
* [TRACKING SETTINGS](#tracking-settings)
|
37
37
|
* [USER](#user)
|
38
38
|
* [WHITELABEL](#whitelabel)
|
39
39
|
|
40
40
|
|
41
|
-
<a name="
|
41
|
+
<a name="access-settings"></a>
|
42
42
|
# ACCESS SETTINGS
|
43
43
|
|
44
44
|
## Retrieve all recent access attempts
|
@@ -136,7 +136,7 @@ puts response.headers
|
|
136
136
|
```
|
137
137
|
## Retrieve a specific whitelisted IP
|
138
138
|
|
139
|
-
**This endpoint allows you to
|
139
|
+
**This endpoint allows you to retrieve a specific IP address that has been whitelisted.**
|
140
140
|
|
141
141
|
You must include the ID for the specific IP address you want to retrieve in your call.
|
142
142
|
|
@@ -203,7 +203,7 @@ puts response.headers
|
|
203
203
|
```
|
204
204
|
## Retrieve all alerts
|
205
205
|
|
206
|
-
**This endpoint allows you to
|
206
|
+
**This endpoint allows you to retrieve all of your alerts.**
|
207
207
|
|
208
208
|
Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics.
|
209
209
|
* Usage alerts allow you to set the threshold at which an alert will be sent.
|
@@ -283,12 +283,12 @@ puts response.status_code
|
|
283
283
|
puts response.body
|
284
284
|
puts response.headers
|
285
285
|
```
|
286
|
-
<a name="
|
286
|
+
<a name="api-keys"></a>
|
287
287
|
# API KEYS
|
288
288
|
|
289
289
|
## Create API keys
|
290
290
|
|
291
|
-
**This
|
291
|
+
**This endpoint allows you to create a new random API Key for the user.**
|
292
292
|
|
293
293
|
A JSON request body containing a "name" property is required. If number of maximum keys is reached, HTTP 403 will be returned.
|
294
294
|
|
@@ -406,7 +406,7 @@ puts response.headers
|
|
406
406
|
|
407
407
|
**This endpoint allows you to revoke an existing API Key**
|
408
408
|
|
409
|
-
Authentications using this API Key will fail after this request is made, with some small
|
409
|
+
Authentications using this API Key will fail after this request is made, with some small propagation delay.If the API Key ID does not exist an HTTP 404 will be returned.
|
410
410
|
|
411
411
|
The API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
|
412
412
|
|
@@ -461,7 +461,7 @@ This endpoint will return information for each group ID that you include in your
|
|
461
461
|
|
462
462
|
Suppressions are a list of email addresses that will not receive content sent under a given [group](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html).
|
463
463
|
|
464
|
-
Suppression groups, or [unsubscribe groups](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html), allow you to label a category of content that you regularly send. This gives your recipients the ability to opt out of a specific set of your email. For example, you might define a group for your transactional email, and one for your marketing email so that your users can continue
|
464
|
+
Suppression groups, or [unsubscribe groups](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html), allow you to label a category of content that you regularly send. This gives your recipients the ability to opt out of a specific set of your email. For example, you might define a group for your transactional email, and one for your marketing email so that your users can continue receiving your transactional email without having to receive your marketing content.
|
465
465
|
|
466
466
|
### GET /asm/groups
|
467
467
|
|
@@ -660,9 +660,9 @@ puts response.headers
|
|
660
660
|
```
|
661
661
|
## Retrieve a Global Suppression
|
662
662
|
|
663
|
-
**This endpoint allows you to retrieve a global suppression. You can also use this endpoint to confirm if an email address is already globally
|
663
|
+
**This endpoint allows you to retrieve a global suppression. You can also use this endpoint to confirm if an email address is already globally suppressed.**
|
664
664
|
|
665
|
-
If the email address you include in the URL path parameter `{email}` is
|
665
|
+
If the email address you include in the URL path parameter `{email}` is already globally suppressed, the response will include that email address. If the address you enter for `{email}` is not globally suppressed, an empty JSON object `{}` will be returned.
|
666
666
|
|
667
667
|
A global suppression (or global unsubscribe) is an email address of a recipient who does not want to receive any of your messages. A globally suppressed recipient will be removed from any email you send. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/global_unsubscribes.html).
|
668
668
|
|
@@ -1578,7 +1578,7 @@ Valid operators for create and update depend on the type of the field you are se
|
|
1578
1578
|
|
1579
1579
|
Segment conditions using "eq" or "ne" for email clicks and opens should provide a "field" of either *clicks.campaign_identifier* or *opens.campaign_identifier*. The condition value should be a string containing the id of a completed campaign.
|
1580
1580
|
|
1581
|
-
Segments may contain multiple
|
1581
|
+
Segments may contain multiple conditions, joined by an "and" or "or" in the "and_or" field. The first condition in the conditions list must have an empty "and_or", and subsequent conditions must all specify an "and_or".
|
1582
1582
|
|
1583
1583
|
The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
|
1584
1584
|
|
@@ -1837,7 +1837,7 @@ puts response.headers
|
|
1837
1837
|
```
|
1838
1838
|
## Retrieve all IP pools.
|
1839
1839
|
|
1840
|
-
**This endpoint allows you to
|
1840
|
+
**This endpoint allows you to retrieve all of your IP pools.**
|
1841
1841
|
|
1842
1842
|
IP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic.
|
1843
1843
|
|
@@ -2240,7 +2240,7 @@ data = JSON.parse('{
|
|
2240
2240
|
"enable": true,
|
2241
2241
|
"html": "If you would like to unsubscribe and stop receiving these emails <% clickhere %>.",
|
2242
2242
|
"substitution_tag": "<%click here%>",
|
2243
|
-
"text": "If you would like to unsubscribe and stop
|
2243
|
+
"text": "If you would like to unsubscribe and stop receiving these emails <% click here %>."
|
2244
2244
|
}
|
2245
2245
|
}
|
2246
2246
|
}')
|
@@ -2249,7 +2249,7 @@ puts response.status_code
|
|
2249
2249
|
puts response.body
|
2250
2250
|
puts response.headers
|
2251
2251
|
```
|
2252
|
-
<a name="
|
2252
|
+
<a name="mail-settings"></a>
|
2253
2253
|
# MAIL SETTINGS
|
2254
2254
|
|
2255
2255
|
## Retrieve all mail settings
|
@@ -2619,7 +2619,7 @@ puts response.status_code
|
|
2619
2619
|
puts response.body
|
2620
2620
|
puts response.headers
|
2621
2621
|
```
|
2622
|
-
<a name="
|
2622
|
+
<a name="mailbox-providers"></a>
|
2623
2623
|
# MAILBOX PROVIDERS
|
2624
2624
|
|
2625
2625
|
## Retrieve email statistics by mailbox provider.
|
@@ -2640,7 +2640,7 @@ puts response.status_code
|
|
2640
2640
|
puts response.body
|
2641
2641
|
puts response.headers
|
2642
2642
|
```
|
2643
|
-
<a name="
|
2643
|
+
<a name="partner-settings"></a>
|
2644
2644
|
# PARTNER SETTINGS
|
2645
2645
|
|
2646
2646
|
## Returns a list of all partner settings.
|
@@ -2705,7 +2705,7 @@ puts response.headers
|
|
2705
2705
|
|
2706
2706
|
**This endpoint returns a list of all scopes that this user has access to.**
|
2707
2707
|
|
2708
|
-
API Keys can be used to authenticate the use of [SendGrids v3 Web API](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html), or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html). API Keys may be assigned certain permissions, or scopes, that limit which API endpoints they are able to access. For a more detailed explanation of how you can use API Key
|
2708
|
+
API Keys can be used to authenticate the use of [SendGrids v3 Web API](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html), or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html). API Keys may be assigned certain permissions, or scopes, that limit which API endpoints they are able to access. For a more detailed explanation of how you can use API Key permissions, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/api_keys.html#-API-Key-Permissions) or [Classroom](https://sendgrid.com/docs/Classroom/Basics/API/api_key_permissions.html).
|
2709
2709
|
|
2710
2710
|
### GET /scopes
|
2711
2711
|
|
@@ -2821,7 +2821,7 @@ puts response.headers
|
|
2821
2821
|
```
|
2822
2822
|
## Delete a Sender Identity
|
2823
2823
|
|
2824
|
-
**This
|
2824
|
+
**This endpoint allows you to delete one of your sender identities.**
|
2825
2825
|
|
2826
2826
|
Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`.
|
2827
2827
|
|
@@ -2837,7 +2837,7 @@ puts response.headers
|
|
2837
2837
|
```
|
2838
2838
|
## Resend Sender Identity Verification
|
2839
2839
|
|
2840
|
-
**This
|
2840
|
+
**This endpoint allows you to resend a sender identity verification email.**
|
2841
2841
|
|
2842
2842
|
Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`.
|
2843
2843
|
|
@@ -3124,7 +3124,7 @@ puts response.headers
|
|
3124
3124
|
```
|
3125
3125
|
## Retrieve the monthly email statistics for a single subuser
|
3126
3126
|
|
3127
|
-
**This endpoint allows you to
|
3127
|
+
**This endpoint allows you to retrieve the monthly email statistics for a specific subuser.**
|
3128
3128
|
|
3129
3129
|
While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats for your subusers. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings.
|
3130
3130
|
|
@@ -3620,7 +3620,7 @@ puts response.headers
|
|
3620
3620
|
|
3621
3621
|
**This endpoint allows you to create a new version of a template.**
|
3622
3622
|
|
3623
|
-
Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across
|
3623
|
+
Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across all templates.
|
3624
3624
|
|
3625
3625
|
For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
|
3626
3626
|
|
@@ -3647,7 +3647,7 @@ puts response.headers
|
|
3647
3647
|
|
3648
3648
|
**This endpoint allows you to edit a version of one of your transactional templates.**
|
3649
3649
|
|
3650
|
-
Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across
|
3650
|
+
Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across all templates.
|
3651
3651
|
|
3652
3652
|
For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
|
3653
3653
|
|
@@ -3679,7 +3679,7 @@ puts response.headers
|
|
3679
3679
|
|
3680
3680
|
**This endpoint allows you to retrieve a specific version of a template.**
|
3681
3681
|
|
3682
|
-
Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across
|
3682
|
+
Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across all templates.
|
3683
3683
|
|
3684
3684
|
For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
|
3685
3685
|
|
@@ -3704,7 +3704,7 @@ puts response.headers
|
|
3704
3704
|
|
3705
3705
|
**This endpoint allows you to delete one of your transactional template versions.**
|
3706
3706
|
|
3707
|
-
Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across
|
3707
|
+
Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across all templates.
|
3708
3708
|
|
3709
3709
|
For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
|
3710
3710
|
|
@@ -3729,7 +3729,7 @@ puts response.headers
|
|
3729
3729
|
|
3730
3730
|
**This endpoint allows you to activate a version of one of your templates.**
|
3731
3731
|
|
3732
|
-
Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across
|
3732
|
+
Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across all templates.
|
3733
3733
|
|
3734
3734
|
|
3735
3735
|
For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
|
@@ -3751,7 +3751,7 @@ puts response.status_code
|
|
3751
3751
|
puts response.body
|
3752
3752
|
puts response.headers
|
3753
3753
|
```
|
3754
|
-
<a name="
|
3754
|
+
<a name="tracking-settings"></a>
|
3755
3755
|
# TRACKING SETTINGS
|
3756
3756
|
|
3757
3757
|
## Retrieve Tracking Settings
|
@@ -3974,7 +3974,7 @@ puts response.headers
|
|
3974
3974
|
|
3975
3975
|
**This endpoint allows you to retrieve the current credit balance for your account.**
|
3976
3976
|
|
3977
|
-
Your monthly credit allotment limits the number of emails you may send before incurring overage charges. For more information about credits and billing, please visit our [
|
3977
|
+
Your monthly credit allotment limits the number of emails you may send before incurring overage charges. For more information about credits and billing, please visit our [Classroom](https://sendgrid.com/docs/Classroom/Basics/Billing/billing_info_and_faqs.html).
|
3978
3978
|
|
3979
3979
|
### GET /user/credits
|
3980
3980
|
|
@@ -4357,7 +4357,7 @@ puts response.headers
|
|
4357
4357
|
|
4358
4358
|
**This endpoint allows you to retrieve all of your current inbound parse settings.**
|
4359
4359
|
|
4360
|
-
The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the
|
4360
|
+
The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html).
|
4361
4361
|
|
4362
4362
|
### GET /user/webhooks/parse/settings
|
4363
4363
|
|
@@ -4372,7 +4372,7 @@ puts response.headers
|
|
4372
4372
|
|
4373
4373
|
**This endpoint allows you to update a specific inbound parse setting.**
|
4374
4374
|
|
4375
|
-
The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the
|
4375
|
+
The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html).
|
4376
4376
|
|
4377
4377
|
### PATCH /user/webhooks/parse/settings/{hostname}
|
4378
4378
|
|
@@ -4393,7 +4393,7 @@ puts response.headers
|
|
4393
4393
|
|
4394
4394
|
**This endpoint allows you to retrieve a specific inbound parse setting.**
|
4395
4395
|
|
4396
|
-
The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the
|
4396
|
+
The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html).
|
4397
4397
|
|
4398
4398
|
### GET /user/webhooks/parse/settings/{hostname}
|
4399
4399
|
|
@@ -4409,7 +4409,7 @@ puts response.headers
|
|
4409
4409
|
|
4410
4410
|
**This endpoint allows you to delete a specific inbound parse setting.**
|
4411
4411
|
|
4412
|
-
The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the
|
4412
|
+
The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html).
|
4413
4413
|
|
4414
4414
|
### DELETE /user/webhooks/parse/settings/{hostname}
|
4415
4415
|
|
@@ -4423,9 +4423,9 @@ puts response.headers
|
|
4423
4423
|
```
|
4424
4424
|
## Retrieves Inbound Parse Webhook statistics.
|
4425
4425
|
|
4426
|
-
**This endpoint allows you to retrieve the statistics for your Parse Webhook
|
4426
|
+
**This endpoint allows you to retrieve the statistics for your Parse Webhook usage.**
|
4427
4427
|
|
4428
|
-
SendGrid's Inbound Parse Webhook allows you to parse the contents and attachments of
|
4428
|
+
SendGrid's Inbound Parse Webhook allows you to parse the contents and attachments of incoming emails. The Parse API can then POST the parsed emails to a URL that you specify. The Inbound Parse Webhook cannot parse messages greater than 20MB in size, including all attachments.
|
4429
4429
|
|
4430
4430
|
There are a number of pre-made integrations for the SendGrid Parse Webhook which make processing events easy. You can find these integrations in the [Library Index](https://sendgrid.com/docs/Integrate/libraries.html#-Webhook-Libraries).
|
4431
4431
|
|
@@ -4522,7 +4522,7 @@ puts response.headers
|
|
4522
4522
|
|
4523
4523
|
A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
|
4524
4524
|
|
4525
|
-
Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The
|
4525
|
+
Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The parent may then associate the whitelabel via the subuser management tools.
|
4526
4526
|
|
4527
4527
|
For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)
|
4528
4528
|
|
@@ -4546,7 +4546,7 @@ puts response.headers
|
|
4546
4546
|
|
4547
4547
|
A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
|
4548
4548
|
|
4549
|
-
Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The
|
4549
|
+
Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The parent may then associate the whitelabel via the subuser management tools.
|
4550
4550
|
|
4551
4551
|
For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)
|
4552
4552
|
|
@@ -4629,7 +4629,7 @@ puts response.headers
|
|
4629
4629
|
|
4630
4630
|
A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
|
4631
4631
|
|
4632
|
-
Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The
|
4632
|
+
Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The parent may then associate the whitelabel via the subuser management tools.
|
4633
4633
|
|
4634
4634
|
For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)
|
4635
4635
|
|
@@ -4751,7 +4751,7 @@ puts response.headers
|
|
4751
4751
|
```
|
4752
4752
|
## Retrieve all IP whitelabels
|
4753
4753
|
|
4754
|
-
**This endpoint allows you to retrieve all of the IP whitelabels that have been
|
4754
|
+
**This endpoint allows you to retrieve all of the IP whitelabels that have been created by this account.**
|
4755
4755
|
|
4756
4756
|
You may include a search key by using the "ip" parameter. This enables you to perform a prefix search for a given IP segment (e.g. "192.").
|
4757
4757
|
|
@@ -4894,7 +4894,7 @@ puts response.headers
|
|
4894
4894
|
**This endpoint allows you to retrieve the associated link whitelabel for a subuser.**
|
4895
4895
|
|
4896
4896
|
Link whitelables can be associated with subusers from the parent account. This functionality allows
|
4897
|
-
subusers to send mail using their parent's
|
4897
|
+
subusers to send mail using their parent's link whitelabels. To associate a link whitelabel, the parent account
|
4898
4898
|
must first create a whitelabel and validate it. The parent may then associate that whitelabel with a subuser via the API or the Subuser Management page in the user interface.
|
4899
4899
|
|
4900
4900
|
Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
|
@@ -4916,7 +4916,7 @@ puts response.headers
|
|
4916
4916
|
**This endpoint allows you to disassociate a link whitelabel from a subuser.**
|
4917
4917
|
|
4918
4918
|
Link whitelables can be associated with subusers from the parent account. This functionality allows
|
4919
|
-
subusers to send mail using their parent's
|
4919
|
+
subusers to send mail using their parent's link whitelabels. To associate a link whitelabel, the parent account
|
4920
4920
|
must first create a whitelabel and validate it. The parent may then associate that whitelabel with a subuser via the API or the Subuser Management page in the user interface.
|
4921
4921
|
|
4922
4922
|
Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
|
@@ -5013,7 +5013,7 @@ puts response.headers
|
|
5013
5013
|
**This endpoint allows you to associate a link whitelabel with a subuser account.**
|
5014
5014
|
|
5015
5015
|
Link whitelables can be associated with subusers from the parent account. This functionality allows
|
5016
|
-
subusers to send mail using their parent's
|
5016
|
+
subusers to send mail using their parent's link whitelabels. To associate a link whitelabel, the parent account
|
5017
5017
|
must first create a whitelabel and validate it. The parent may then associate that whitelabel with a subuser via the API or the Subuser Management page in the user interface.
|
5018
5018
|
|
5019
5019
|
Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
|
@@ -5033,4 +5033,3 @@ puts response.status_code
|
|
5033
5033
|
puts response.body
|
5034
5034
|
puts response.headers
|
5035
5035
|
```
|
5036
|
-
|