sendgrid-ruby 5.3.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.github/PULL_REQUEST_TEMPLATE +3 -1
  3. data/CHANGELOG.md +25 -0
  4. data/CODE_OF_CONDUCT.md +11 -11
  5. data/CONTRIBUTING.md +17 -22
  6. data/LICENSE.txt +1 -1
  7. data/README.md +25 -12
  8. data/Rakefile +1 -1
  9. data/TROUBLESHOOTING.md +21 -15
  10. data/UPGRADE.md +5 -0
  11. data/USAGE.md +1103 -1101
  12. data/USE_CASES.md +248 -18
  13. data/examples/helpers/mail/example.rb +7 -7
  14. data/examples/ips/ips.rb +13 -0
  15. data/examples/mail/mail.rb +2 -2
  16. data/examples/scopes/scopes.rb +49 -3
  17. data/examples/{whitelabel/whitelabel.rb → senderauthentication/senderauthentication.rb} +27 -27
  18. data/examples/suppression/suppression.rb +10 -10
  19. data/lib/sendgrid-ruby.rb +2 -0
  20. data/lib/sendgrid/client.rb +12 -9
  21. data/lib/sendgrid/helpers/inbound/README.md +22 -5
  22. data/lib/sendgrid/helpers/inbound/app.rb +13 -1
  23. data/lib/sendgrid/helpers/inbound/public/index.html +1 -1
  24. data/lib/sendgrid/helpers/inbound/sample_data/default_data.txt +2 -2
  25. data/lib/sendgrid/helpers/inbound/sample_data/raw_data.txt +2 -2
  26. data/lib/sendgrid/helpers/inbound/sample_data/raw_data_with_attachments.txt +2 -2
  27. data/lib/sendgrid/helpers/inbound/send.rb +2 -2
  28. data/lib/sendgrid/helpers/ip_management/ip_management.rb +17 -0
  29. data/lib/sendgrid/helpers/mail/README.md +1 -1
  30. data/lib/sendgrid/helpers/mail/attachment.rb +24 -1
  31. data/lib/sendgrid/helpers/mail/category.rb +0 -8
  32. data/lib/sendgrid/helpers/mail/content.rb +3 -16
  33. data/lib/sendgrid/helpers/mail/email.rb +3 -16
  34. data/lib/sendgrid/helpers/mail/mail.rb +8 -40
  35. data/lib/sendgrid/helpers/permissions/scope.rb +28 -0
  36. data/lib/sendgrid/helpers/permissions/scopes.yml +309 -0
  37. data/lib/sendgrid/helpers/settings/README.md +1 -1
  38. data/lib/sendgrid/helpers/stats/stats_response.rb +1 -1
  39. data/lib/sendgrid/version.rb +1 -1
  40. data/mail_helper_v3.md +9 -9
  41. data/sendgrid-ruby.gemspec +3 -3
  42. data/spec/sendgrid/helpers/ip_management/ip_management_spec.rb +12 -0
  43. data/test/sendgrid/helpers/mail/test_attachment.rb +35 -0
  44. data/test/sendgrid/helpers/mail/test_mail.rb +29 -21
  45. data/test/sendgrid/permissions/test_scopes.rb +38 -0
  46. data/test/sendgrid/test_sendgrid-ruby.rb +15 -7
  47. metadata +17 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 796596b834ff9725ad09dd290829bd710b88789f
4
- data.tar.gz: 1d572c07d391a91a4e3f3c279b3fc9ef74128b83
3
+ metadata.gz: 2a951fe9149a9c9e1ca5e9c9ce053995bb80810c
4
+ data.tar.gz: e974acc6b662c335d35ad99702a173a70b656c0c
5
5
  SHA512:
6
- metadata.gz: 5285bba04ae710a028e424ce7b34676e09a4dbf5b2c20eed61205078d97011a3aadbea65f6562dd84883b6583203f28751834ecde2ad225bdcd7ba5bb8ef71dd
7
- data.tar.gz: e5eb5ec7768129a04c65fcc4e5e3f2ab88013f4d6d79eec9252ed20f72fb3120d10527efda11127e80440f10b1e5a3e72c568afa7b094ceac4b1196424b53804
6
+ metadata.gz: 9f51d4253bd7708337a981c2f196b4e37f3d8b092a469d11b7300815d3faef5bec7c6df32c98c1be8158dd71146d87d4983b560710d4d8715dcf0f1d55f6b62d
7
+ data.tar.gz: 7beeb7406e6e7b5370d42aa5d35b471bcab706b43bead079a58104cc4f641b19f7fa11ec6f17b95d7e0f371c5dde99832369b8fc2940457a907a64d214c0d0d2
@@ -1,6 +1,7 @@
1
1
  <!--
2
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
3
 
4
+ **All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.**
4
5
 
5
6
  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
7
  e.g.
@@ -10,6 +11,7 @@ Closes #2
10
11
  # Fixes #
11
12
 
12
13
  ### Checklist
14
+ - [ ] I acknowledge that all my contributions will be made under the project's license
13
15
  - [ ] I have made a material change to the repo (functionality, testing, spelling, grammar)
14
16
  - [ ] I have read the [Contribution Guide] and my PR follows them.
15
17
  - [ ] I updated my branch with the master branch.
@@ -21,4 +23,4 @@ Closes #2
21
23
  -
22
24
  -
23
25
 
24
- If you have questions, please send an email to [Sendgrid](mailto:dx@sendgrid.com), or file a Github Issue in this repository.
26
+ If you have questions, please send an email to [Twilio SendGrid](mailto:dx@sendgrid.com), or file a Github Issue in this repository.
@@ -1,6 +1,31 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [6.0.0] - 2019-06-04 ##
5
+ ### BREAKING CHANGE
6
+ - [PR #284](https://github.com/sendgrid/sendgrid-ruby/pull/284): The sinatra gem is no longer specified as a dependency of this gem. If you would like to use the inbound processing, please follow the [upgrade guide](https://github.com/sendgrid/sendgrid-ruby/blob/master/UPGRADE.md). Big thanks to [@jjb](https://github.com/jjb) for the PR!
7
+
8
+ ### Added
9
+ - [PR #271](https://github.com/sendgrid/sendgrid-ruby/pull/271): Add ability to impersonate a subuser. Big thanks to [@danilospa](https://github.com/danilospa) for the PR!
10
+ - [PR #278](https://github.com/sendgrid/sendgrid-ruby/pull/278): Make SendGrid permissions management easy. Big thanks to [@sony-mathew](https://github.com/sony-mathew) for the PR!
11
+ - [PR #343](https://github.com/sendgrid/sendgrid-ruby/pull/343) and [PR #345](https://github.com/sendgrid/sendgrid-ruby/pull/345): Update README.md with examples for dynamic templates and corrections to the old legacy template example. Big thanks to [@kylearoberts](https://github.com/kylearoberts) for the PR!
12
+ - [PR #216](https://github.com/sendgrid/sendgrid-ruby/pull/216): Get unassigned IPs example. Big thanks to [@cristianossd](https://github.com/cristianossd) for the PR!
13
+ - [PR #231](https://github.com/sendgrid/sendgrid-ruby/pull/231): Add support for IO objects set as Attachment content. Big thanks to [@awj](https://github.com/awj) for the PR!
14
+ - [PR #232](https://github.com/sendgrid/sendgrid-ruby/pull/232): Add method to check email content for secret keys. Big thanks to [@jaredsilver](https://github.com/jaredsilver) for the PR!
15
+ - [PR #236](https://github.com/sendgrid/sendgrid-ruby/pull/236): Add an IpManagement helper. Big thanks to [@brokenthumbs](https://github.com/brokenthumbs) for the PR!
16
+ - [PR #264](https://github.com/sendgrid/sendgrid-ruby/pull/264): Add Email Statistics helper example. Big thanks to [@jeremyjung](https://github.com/jeremyjung) for the PR!
17
+ - [PR #246](https://github.com/sendgrid/sendgrid-ruby/pull/246): Modified Mail Class calling examples with SendGrid::Mail. Big thanks to [@rohan-techfreak](https://github.com/rohan-techfreak) for the PR!
18
+ - [PR #268](https://github.com/sendgrid/sendgrid-ruby/pull/268): Added Code Review to CONTRIBUTING.md. Big thanks to [@mptap](https://github.com/mptap) for the PR!
19
+ - [PR #276](https://github.com/sendgrid/sendgrid-ruby/pull/276): Codebase Improvement: Use attr_accessor instead of getters and setters. Big thanks to [@rahul26goyal](https://github.com/rahul26goyal) for the PR!
20
+ - [PR #365](https://github.com/sendgrid/sendgrid-ruby/pull/365): Add our Developer Experience Engineer career opportunity to the README. Big thanks to [@mptap](https://github.com/mptap) for the PR!
21
+
22
+ ### Fixes
23
+ - [PR #262](https://github.com/sendgrid/sendgrid-ruby/pull/262): Fix CONTRIBUTING.md formatting. Big thanks to [@thepriefy](https://github.com/thepriefy) for the PR!
24
+ - [PR #277](https://github.com/sendgrid/sendgrid-ruby/pull/277): Fix travis warning. Big thanks to [@rahul26goyal](https://github.com/rahul26goyal) for the PR!
25
+ - [PR #303](https://github.com/sendgrid/sendgrid-ruby/pull/303): Update readme tags and fix minor test failures. Big thanks to [@af4ro](https://github.com/af4ro) for the PR!
26
+ - [PR #370](https://github.com/sendgrid/sendgrid-ruby/pull/370): Remove references to "Whitelabel". Big thanks to [@crweiner](https://github.com/crweiner) for the PR!
27
+ - [PR #383](https://github.com/sendgrid/sendgrid-ruby/pull/383): Correct endpoint for single spam report requests. Big thanks to [@bermannoah](https://github.com/bermannoah) for the PR!
28
+
4
29
  ## [5.3.0] - 2018-10-12 ##
5
30
  ### Added
6
31
  - [PR #300](https://github.com/sendgrid/sendgrid-ruby/pull/300): Support for Dynamic Templates. Big thanks to [@nedcampion](https://github.com/nedcampion) for the PR!
@@ -1,15 +1,15 @@
1
- # SendGrid Community Code of Conduct
1
+ # Twilio SendGrid Community Code of Conduct
2
2
 
3
- The SendGrid open source community is made up of members from around the globe with a diverse set of skills, personalities, and experiences. It is through these differences that our community experiences successes and continued growth. When you're working with members of the community, we encourage you to follow these guidelines, which help steer our interactions and strive to maintain a positive, successful and growing community.
3
+ The Twilio 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
4
 
5
5
  ### Be Open
6
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
7
 
8
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.
9
+ Members of the community are considerate of their peers, which include other contributors and users of Twilio 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
10
 
11
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.
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 Twilio 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
13
 
14
14
  ## Additional Guidance
15
15
 
@@ -17,25 +17,25 @@ Members of the community are respectful. We're respectful of others, their posit
17
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
18
 
19
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.
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 [Twilio SendGrid’s cultural values](https://sendgrid.com/blog/employee-engagement-the-4h-way) defined by our “4H’s”: Happy, Hungry, Humble and Honest.
21
21
 
22
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.
23
+ Most members of the Twilio 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
24
 
25
25
  ## If you have concerns about someone’s conduct
26
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
27
 
28
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
29
 
30
- **Contact the Moderators** - You can reach the SendGrid moderators by emailing dx@sendgrid.com.
30
+ **Contact the Moderators** - You can reach the Twilio SendGrid moderators by emailing dx@sendgrid.com.
31
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).
32
+ ## Submission to Twilio SendGrid Repositories
33
+ Finally, just a reminder, changes to the Twilio SendGrid repositories will only be accepted upon completion of the [Twilio SendGrid Contributor Agreement](https://cla.sendgrid.com).
34
34
 
35
35
  ## Attribution
36
36
 
37
- SendGrid thanks the following, on which it draws for content and inspiration:
37
+ Twilio SendGrid thanks the following, on which it draws for content and inspiration:
38
38
 
39
- * [Python Community Code of Conduct](https://www.python.org/psf/codeofconduct/)
39
+ * [Ruby Community Code of Conduct](https://www.python.org/psf/codeofconduct/)
40
40
  * [Open Source Initiative General Code of Conduct](https://opensource.org/codeofconduct)
41
41
  * [Apache Code of Conduct](https://www.apache.org/foundation/policies/conduct.html)
@@ -1,35 +1,25 @@
1
- Hello! Thank you for choosing to help contribute to one of the SendGrid open source libraries. There are many ways you can contribute and help is always welcome. We simply ask that you follow the following contribution policies.
1
+ Hello! Thank you for choosing to help contribute to one of the Twilio SendGrid open-source libraries. There are many ways you can contribute and help is always welcome. We simply ask that you follow the following contribution policies.
2
2
 
3
- - [CLAs and CCLAs](#clas-and-cclas)
3
+ **All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.**
4
4
  - [Feature Request](#feature-request)
5
5
  - [Submit a Bug Report](#submit-a-bug-report)
6
- - [Please use our Bug Report Template](#please-use-our-bug-report-template)
6
+ - [Please use our Bug Report Template](#please-use-our-bug-report-template)
7
7
  - [Improvements to the Codebase](#improvements-to-the-codebase)
8
- - [Development Environment](#development-environment)
9
- - [Install and Run Locally](#install-and-run-locally)
10
- - [Prerequisites](#prerequisites)
11
- - [Initial setup:](#initial-setup)
12
- - [Environment Variables](#environment-variables)
13
- - [Execute:](#execute)
8
+ - [Development Environment](#development-environment)
9
+ - [Install and Run Locally](#install-and-run-locally)
10
+ - [Prerequisites](#prerequisites)
11
+ - [Initial setup:](#initial-setup)
12
+ - [Environment Variables](#environment-variables)
13
+ - [Execute:](#execute)
14
14
  - [Understanding the Code Base](#understanding-the-code-base)
15
15
  - [Testing](#testing)
16
16
  - [Style Guidelines & Naming Conventions](#style-guidelines--naming-conventions)
17
17
  - [Creating a Pull Request](#creating-a-pull-request)
18
+ - [Code Reviews](#code-reviews)
18
19
 
19
20
  <a name="roadmap"></a>
20
21
  We use [Milestones](https://github.com/sendgrid/sendgrid-ruby/milestones) to help define current roadmaps, please feel free to grab an issue from the current milestone. Please indicate that you have begun work on it to avoid collisions. Once a PR is made, community review, comments, suggestions and additional PRs are welcomed and encouraged.
21
22
 
22
- <a name="cla"></a>
23
- ## CLAs and CCLAs
24
-
25
- Before you get started, SendGrid requires that a SendGrid Contributor License Agreement (CLA) be filled out by every contributor to a SendGrid open source project.
26
-
27
- Our goal with the CLA is to clarify the rights of our contributors and reduce other risks arising from inappropriate contributions. The CLA also clarifies the rights SendGrid holds in each contribution and helps to avoid misunderstandings over what rights each contributor is required to grant to SendGrid when making a contribution. In this way the CLA encourages broad participation by our open source community and helps us build strong open source projects, free from any individual contributor withholding or revoking rights to any contribution.
28
-
29
- SendGrid does not merge a pull request made against a SendGrid open source project until that pull request is associated with a signed CLA. Copies of the CLA are available [here](https://gist.github.com/SendGridDX/98b42c0a5d500058357b80278fde3be8#file-sendgrid_cla).
30
-
31
- When you create a Pull Request, after a few seconds, a comment will appear with a link to the CLA. Click the link and fill out the brief form and then click the "I agree" button and you are all set. You will not be asked to re-sign the CLA unless we make a change.
32
-
33
23
  There are a few ways to contribute, which we'll enumerate below:
34
24
 
35
25
  <a name="feature-request"></a>
@@ -89,9 +79,9 @@ We welcome direct contributions to the sendgrid-ruby code base. Thank you!
89
79
  bundle install
90
80
  ```
91
81
 
92
- ## Environment Variables
82
+ ### Environment Variables
93
83
 
94
- First, get your free SendGrid account [here](https://sendgrid.com/free?source=sendgrid-ruby).
84
+ First, get your free Twilio SendGrid account [here](https://sendgrid.com/free?source=sendgrid-ruby).
95
85
 
96
86
  Next, update your environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys).
97
87
 
@@ -217,3 +207,8 @@ Please run your code through:
217
207
  with a clear title and description against the `master` branch. All tests must be passing before we will review the PR.
218
208
 
219
209
  If you have any additional questions, please feel free to [email](mailto:dx@sendgrid.com) us or create an issue in this repo.
210
+
211
+ <a name="code-reviews"></a>
212
+ ## Code Reviews
213
+
214
+ If you can, please look at open PRs and review them. Give feedback and help us merge these PRs much faster! If you don't know how, Github has some [great information on how to review a Pull Request](https://help.github.com/articles/about-pull-request-reviews/).
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2018 SendGrid, Inc.
1
+ Copyright (c) 2014-2019 Twilio SendGrid, Inc.
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,14 +1,20 @@
1
- ![SendGrid Logo](https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png)
1
+ ![Twilio SendGrid Logo](https://github.com/sendgrid/sendgrid-python/raw/master/twilio_sendgrid_logo.png)
2
2
 
3
- [![Travis Badge](https://travis-ci.org/sendgrid/sendgrid-ruby.svg?branch=master)](https://travis-ci.org/sendgrid/sendgrid-ruby) [![Gem Version](https://badge.fury.io/rb/sendgrid-ruby.svg)](https://badge.fury.io/rb/sendgrid-ruby)[![Email Notifications Badge](https://dx.sendgrid.com/badge/ruby)](https://dx.sendgrid.com/newsletter/ruby)[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt)[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)[![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/sendgrid-ruby.svg)](https://github.com/sendgrid/sendgrid-ruby/graphs/contributors)
3
+ [![Travis Badge](https://travis-ci.org/sendgrid/sendgrid-ruby.svg?branch=master)](https://travis-ci.org/sendgrid/sendgrid-ruby)
4
+ [![Gem Version](https://badge.fury.io/rb/sendgrid-ruby.svg)](https://badge.fury.io/rb/sendgrid-ruby)
5
+ [![Email Notifications Badge](https://dx.sendgrid.com/badge/ruby)](https://dx.sendgrid.com/newsletter/ruby)
6
+ [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt)
7
+ [![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
8
+ [![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/sendgrid-ruby.svg)](https://github.com/sendgrid/sendgrid-ruby/graphs/contributors)
9
+ [![Open Source Helpers](https://www.codetriage.com/sendgrid/sendgrid-ruby/badges/users.svg)](https://www.codetriage.com/sendgrid/sendgrid-ruby)
4
10
 
5
11
  **NEW:** Subscribe to email [notifications](https://dx.sendgrid.com/newsletter/ruby) for releases and breaking changes.
6
12
 
7
- **This library allows you to quickly and easily use the SendGrid Web API v3 via Ruby.**
13
+ **This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via Ruby.**
8
14
 
9
- Version 3.X.X+ of this library provides full support for all SendGrid [Web API v3](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html) endpoints, including the new [v3 /mail/send](https://sendgrid.com/blog/introducing-v3mailsend-sendgrids-new-mail-endpoint).
15
+ Version 3.X.X+ of this library provides full support for all Twilio SendGrid [Web API v3](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html) endpoints, including the new [v3 /mail/send](https://sendgrid.com/blog/introducing-v3mailsend-sendgrids-new-mail-endpoint).
10
16
 
11
- This library represents the beginning of a new path for SendGrid. We want this library to be community driven and SendGrid led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/sendgrid/sendgrid-ruby/issues) and [pull requests](https://github.com/sendgrid/sendgrid-ruby/blob/master/CONTRIBUTING.md) or simply upvote or comment on existing issues or pull requests.
17
+ This library represents the beginning of a new path for Twilio SendGrid. We want this library to be community driven and Twilio SendGrid led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/sendgrid/sendgrid-ruby/issues) and [pull requests](https://github.com/sendgrid/sendgrid-ruby/blob/master/CONTRIBUTING.md) or simply upvote or comment on existing issues or pull requests.
12
18
 
13
19
  Please browse the rest of this README for further details.
14
20
 
@@ -16,6 +22,7 @@ We appreciate your continued support, thank you!
16
22
 
17
23
  # Table of Contents
18
24
 
25
+ * [Announcements](#announcements)
19
26
  * [Installation](#installation)
20
27
  * [Quick Start](#quick-start)
21
28
  * [Processing Inbound Email](#inbound)
@@ -28,13 +35,19 @@ We appreciate your continued support, thank you!
28
35
  * [About](#about)
29
36
  * [License](#license)
30
37
 
38
+ <a name="announcements"></a>
39
+ # Announcements
40
+
41
+ **NEW:** If you're a software engineer who is passionate about #DeveloperExperience and/or #OpenSource, [this is an incredible opportunity to join our #DX team](https://sendgrid.com/careers/role/1421152/?gh_jid=1421152) as a Developer Experience Engineer and work with [@thinkingserious](https://github.com/thinkingserious) and [@aroach](https://github.com/aroach)! Tell your friends :)
42
+
43
+
31
44
  <a name="installation"></a>
32
45
  # Installation
33
46
 
34
47
  ## Prerequisites
35
48
 
36
- - Ruby version >= 2.2
37
- - The SendGrid service, starting at the [free level](https://sendgrid.com/free?source=sendgrid-ruby)
49
+ - Ruby version >= 2.2 (except version [2.6.0](https://github.com/sendgrid/sendgrid-ruby/blob/master/TROUBLESHOOTING.md#ruby-versions))
50
+ - The Twilio SendGrid service, starting at the [free level](https://sendgrid.com/free?source=sendgrid-ruby)
38
51
 
39
52
  ## Setup Environment Variables
40
53
 
@@ -68,7 +81,6 @@ gem install sendgrid-ruby
68
81
  ## Dependencies
69
82
 
70
83
  - [Ruby-HTTP-Client](https://github.com/sendgrid/ruby-http-client)
71
- - [Sinatra](http://www.sinatrarb.com/) - this is only needed if you plan to process [Inbound Email](#inbound).
72
84
 
73
85
  <a name="quick-start"></a>
74
86
  # Quick Start
@@ -85,7 +97,7 @@ include SendGrid
85
97
 
86
98
  from = SendGrid::Email.new(email: 'test@example.com')
87
99
  to = SendGrid::Email.new(email: 'test@example.com')
88
- subject = 'Sending with SendGrid is Fun'
100
+ subject = 'Sending with Twilio SendGrid is Fun'
89
101
  content = SendGrid::Content.new(type: 'text/plain', value: 'and easy to do anywhere, even with Ruby')
90
102
  mail = SendGrid::Mail.new(from, subject, to, content)
91
103
 
@@ -115,7 +127,7 @@ data = JSON.parse('{
115
127
  "email": "test@example.com"
116
128
  }
117
129
  ],
118
- "subject": "Sending with SendGrid is Fun"
130
+ "subject": "Sending with Twilio SendGrid is Fun"
119
131
  }
120
132
  ],
121
133
  "from": {
@@ -168,7 +180,7 @@ Please see [our helper](https://github.com/sendgrid/sendgrid-ruby/tree/master/li
168
180
  <a name="usage"></a>
169
181
  # Usage
170
182
 
171
- - [SendGrid Docs](https://sendgrid.com/docs/API_Reference/index.html)
183
+ - [Twilio SendGrid Docs](https://sendgrid.com/docs/API_Reference/index.html)
172
184
  - [Library Usage Docs](https://github.com/sendgrid/sendgrid-ruby/tree/master/USAGE.md)
173
185
  - [Example Code](https://github.com/sendgrid/sendgrid-ruby/tree/master/examples)
174
186
  - [How-to: Migration from v2 to v3](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/how_to_migrate_from_v2_to_v3_mail_send.html)
@@ -201,6 +213,7 @@ We encourage contribution to our libraries (you might even score some nifty swag
201
213
  - [Bug Reports](https://github.com/sendgrid/sendgrid-ruby/tree/master/CONTRIBUTING.md#submit_a_bug_report)
202
214
  - [Sign the CLA to Create a Pull Request](https://github.com/sendgrid/sendgrid-ruby/tree/master/CONTRIBUTING.md#cla)
203
215
  - [Improvements to the Codebase](https://github.com/sendgrid/sendgrid-ruby/tree/master/CONTRIBUTING.md#improvements_to_the_codebase)
216
+ - [Review Pull Requests](https://github.com/sendgrid/sendgrid-ruby/blob/master/CONTRIBUTING.md#code-reviews)
204
217
 
205
218
  <a name="troubleshooting"></a>
206
219
  # Troubleshooting
@@ -210,7 +223,7 @@ Please see our [troubleshooting guide](https://github.com/sendgrid/sendgrid-ruby
210
223
  <a name="about"></a>
211
224
  # About
212
225
 
213
- sendgrid-ruby is guided and supported by the SendGrid [Developer Experience Team](mailto:dx@sendgrid.com).
226
+ sendgrid-ruby is guided and supported by the [Developer Experience Team](mailto:dx@sendgrid.com).
214
227
 
215
228
  sendgrid-ruby is maintained and funded by SendGrid, Inc. The names and logos for sendgrid-ruby are trademarks of SendGrid, Inc.
216
229
 
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ require 'rspec/core/rake_task'
4
4
 
5
5
  Rake::TestTask.new do |t|
6
6
  t.libs << 'test'
7
- t.test_files = FileList['test/sendgrid/test*.rb', 'test/sendgrid/helpers/mail/test*.rb']
7
+ t.test_files = FileList['test/sendgrid/test*.rb', 'test/sendgrid/helpers/mail/test*.rb', 'test/sendgrid/helpers/permissions/test*.rb']
8
8
  t.verbose = true
9
9
  end
10
10
 
@@ -1,19 +1,20 @@
1
- If you have a non-library SendGrid issue, please contact our [support team](https://support.sendgrid.com).
1
+ If you have a non-library Twilio SendGrid issue, please contact our [support team](https://support.sendgrid.com).
2
2
 
3
3
  If you can't find a solution below, please open an [issue](https://github.com/sendgrid/sendgrid-ruby/issues).
4
4
 
5
5
 
6
6
  ## Table of Contents
7
7
 
8
- * [Migrating from v2 to v3](#migrating)
9
- * [Continue Using v2](#v2)
10
- * [Testing v3 /mail/send Calls Directly](#testing)
11
- * [Error Messages](#error)
12
- * [Versions](#versions)
13
- * [Environment Variables and Your SendGrid API Key](#environment)
14
- * [Using the Package Manager](#package-manager)
8
+ * [Migrating from v2 to v3](#migrating-from-v2-to-v3)
9
+ * [Continue Using v2](#continue-using-v2)
10
+ * [Testing v3 /mail/send Calls Directly](#testing-v3-mailsend-calls-directly)
11
+ * [Error Messages](#error-messages)
12
+ * [Versioning](#versioning)
13
+ * [Environment Variables and Your Twilio SendGrid API Key](#environment-variables-and-your-twilio-sendgrid-api-key)
14
+ * [Using the Package Manager](#using-the-package-manager)
15
15
  * [Rails Specifics](#rails-specifics)
16
- * [Viewing the Request Body](#request-body)
16
+ * [Ruby Versions](#ruby-versions)
17
+ * [Viewing the Request Body](#viewing-the-request-body)
17
18
 
18
19
  <a name="migrating"></a>
19
20
  ## Migrating from v2 to v3
@@ -67,17 +68,17 @@ rescue Exception => e
67
68
  end
68
69
  ```
69
70
 
70
- <a name="versions"></a>
71
- ## Versions
71
+ <a name="versioning"></a>
72
+ ## Versioning
72
73
 
73
74
  We follow the MAJOR.MINOR.PATCH versioning scheme as described by [SemVer.org](http://semver.org). Therefore, we recommend that you always pin (or vendor) the particular version you are working with to your code and never auto-update to the latest version. Especially when there is a MAJOR point release, since that is guaranteed to be a breaking change. Changes are documented in the [CHANGELOG](https://github.com/sendgrid/sendgrid-ruby/blob/master/CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-ruby/releases) section.
74
75
 
75
76
  <a name="environment"></a>
76
- ## Environment Variables and Your SendGrid API Key
77
+ ## Environment Variables and Your Twilio SendGrid API Key
77
78
 
78
- All of our examples assume you are using [environment variables](https://github.com/sendgrid/sendgrid-ruby#setup-environment-variables) to hold your SendGrid API key.
79
+ All of our examples assume you are using [environment variables](https://github.com/sendgrid/sendgrid-ruby#setup-environment-variables) to hold your Twilio SendGrid API key.
79
80
 
80
- If you choose to add your SendGrid API key directly (not recommended):
81
+ If you choose to add your Twilio SendGrid API key directly (not recommended):
81
82
 
82
83
  `sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])`
83
84
 
@@ -85,7 +86,7 @@ becomes
85
86
 
86
87
  `sg = SendGrid::API.new(api_key: 'SENDGRID_API_KEY')`
87
88
 
88
- In the first case SENDGRID_API_KEY is in reference to the name of the environment variable, while the second case references the actual SendGrid API Key.
89
+ In the first case SENDGRID_API_KEY is in reference to the name of the environment variable, while the second case references the actual Twilio SendGrid API Key.
89
90
 
90
91
  <a name="package-manager"></a>
91
92
  ## Using the Package Manager
@@ -119,6 +120,11 @@ gem install sendgrid-ruby -v X.X.X
119
120
 
120
121
  - Possibility of a namespace collision between the sendgrid class `Email` and your own defined `Email` class. To avoid these issues, you can skip the `include SendGrid` line and use the `SendGrid::` prefix for Email. Please see this [SO answer](https://stackoverflow.com/questions/41508464/rails-model-name-conflict-with-included-gem?noredirect=1#comment70223099_41508464) for specifics.
121
122
 
123
+ <a name="ruby-versions"></a>
124
+ ## Ruby Versions
125
+
126
+ This SDK [does not work with ruby version 2.6.0](https://github.com/sendgrid/sendgrid-ruby/issues/378) because of [this bug](https://bugs.ruby-lang.org/issues/15468). Please use any other [supported version](https://github.com/sendgrid/sendgrid-ruby#prerequisites).
127
+
122
128
  <a name="request-body"></a>
123
129
  ## Viewing the Request Body
124
130
 
@@ -0,0 +1,5 @@
1
+ # Upgrading from 5.X to 6.X
2
+
3
+ Note, this is only necessary if you are using inbound processing.
4
+
5
+ * Add this gem to your Gemfile: `gem 'sinatra', '>= 1.4.7', '< 3'`
data/USAGE.md CHANGED
@@ -29,13 +29,13 @@ sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
29
29
  * [PARTNER SETTINGS](#partner-settings)
30
30
  * [SCOPES](#scopes)
31
31
  * [SENDERS](#senders)
32
+ * [SENDER AUTHENTICATION](#sender-authentication)
32
33
  * [STATS](#stats)
33
34
  * [SUBUSERS](#subusers)
34
35
  * [SUPPRESSION](#suppression)
35
36
  * [TEMPLATES](#templates)
36
37
  * [TRACKING SETTINGS](#tracking-settings)
37
38
  * [USER](#user)
38
- * [WHITELABEL](#whitelabel)
39
39
 
40
40
 
41
41
  <a name="access-settings"></a>
@@ -294,7 +294,7 @@ A JSON request body containing a "name" property is required. If number of maxim
294
294
 
295
295
  There is a limit of 100 API Keys on your account.
296
296
 
297
- 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).
297
+ The API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the Twilio SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
298
298
 
299
299
  See the [API Key Permissions List](https://sendgrid.com/docs/API_Reference/Web_API_v3/API_Keys/api_key_permissions_list.html) for a list of all available scopes.
300
300
 
@@ -320,7 +320,7 @@ puts response.headers
320
320
 
321
321
  **This endpoint allows you to retrieve all API Keys that belong to the authenticated user.**
322
322
 
323
- 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).
323
+ The API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the Twilio SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
324
324
 
325
325
  ### GET /api_keys
326
326
 
@@ -339,7 +339,7 @@ puts response.headers
339
339
  A JSON request body with a "name" property is required.
340
340
  Most provide the list of all the scopes an api key should have.
341
341
 
342
- 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).
342
+ The API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the Twilio SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
343
343
 
344
344
 
345
345
  ### PUT /api_keys/{api_key_id}
@@ -365,7 +365,7 @@ puts response.headers
365
365
 
366
366
  A JSON request body with a "name" property is required.
367
367
 
368
- 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).
368
+ The API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the Twilio SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
369
369
 
370
370
  ## URI Parameters
371
371
 
@@ -408,7 +408,7 @@ puts response.headers
408
408
 
409
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
- 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).
411
+ The API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the Twilio SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
412
412
 
413
413
  ## URI Parameters
414
414
 
@@ -1094,7 +1094,7 @@ puts response.headers
1094
1094
 
1095
1095
  **This endpoint allows you to create a custom field.**
1096
1096
 
1097
- The contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
1097
+ The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
1098
1098
 
1099
1099
  ### POST /contactdb/custom_fields
1100
1100
 
@@ -1113,7 +1113,7 @@ puts response.headers
1113
1113
 
1114
1114
  **This endpoint allows you to retrieve all custom fields.**
1115
1115
 
1116
- The contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
1116
+ The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
1117
1117
 
1118
1118
  ### GET /contactdb/custom_fields
1119
1119
 
@@ -1128,7 +1128,7 @@ puts response.headers
1128
1128
 
1129
1129
  **This endpoint allows you to retrieve a custom field by ID.**
1130
1130
 
1131
- The contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
1131
+ The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
1132
1132
 
1133
1133
  ### GET /contactdb/custom_fields/{custom_field_id}
1134
1134
 
@@ -1144,7 +1144,7 @@ puts response.headers
1144
1144
 
1145
1145
  **This endpoint allows you to delete a custom field by ID.**
1146
1146
 
1147
- The contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
1147
+ The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
1148
1148
 
1149
1149
  ### DELETE /contactdb/custom_fields/{custom_field_id}
1150
1150
 
@@ -1345,9 +1345,9 @@ puts response.headers
1345
1345
 
1346
1346
  The body of an API call to this endpoint must include an array of one or more recipient objects.
1347
1347
 
1348
- It is of note that you can add custom field data as parameters on recipient objects. We have provided an example using some of the default custom fields SendGrid provides.
1348
+ It is of note that you can add custom field data as parameters on recipient objects. We have provided an example using some of the default custom fields Twilio SendGrid provides.
1349
1349
 
1350
- The contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
1350
+ The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
1351
1351
 
1352
1352
  ### PATCH /contactdb/recipients
1353
1353
 
@@ -1369,7 +1369,7 @@ puts response.headers
1369
1369
 
1370
1370
  **This endpoint allows you to add a Marketing Campaigns recipient.**
1371
1371
 
1372
- It is of note that you can add custom field data as a parameter on this endpoint. We have provided an example using some of the default custom fields SendGrid provides.
1372
+ It is of note that you can add custom field data as a parameter on this endpoint. We have provided an example using some of the default custom fields Twilio SendGrid provides.
1373
1373
 
1374
1374
  The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
1375
1375
 
@@ -1421,7 +1421,7 @@ puts response.headers
1421
1421
 
1422
1422
  The body of an API call to this endpoint must include an array of recipient IDs of the recipients you want to delete.
1423
1423
 
1424
- The contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
1424
+ The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
1425
1425
 
1426
1426
  ### DELETE /contactdb/recipients
1427
1427
 
@@ -1457,7 +1457,7 @@ puts response.headers
1457
1457
 
1458
1458
  **This endpoint allows you to retrieve the total number of Marketing Campaigns recipients.**
1459
1459
 
1460
- The contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
1460
+ The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
1461
1461
 
1462
1462
  ### GET /contactdb/recipients/count
1463
1463
 
@@ -1481,7 +1481,7 @@ your epoch time to a date range encompassing the entire day. For example, an epo
1481
1481
  Mon, 02 Feb 2015 00:06:40 GMT, but internally the system will search from Mon, 02 Feb 2015 00:00:00 GMT through
1482
1482
  Mon, 02 Feb 2015 23:59:59 GMT.
1483
1483
 
1484
- The contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
1484
+ The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
1485
1485
 
1486
1486
  ### GET /contactdb/recipients/search
1487
1487
 
@@ -1547,7 +1547,7 @@ puts response.headers
1547
1547
 
1548
1548
  **This endpoint allows you to list all fields that are reserved and can't be used for custom field names.**
1549
1549
 
1550
- The contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
1550
+ The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
1551
1551
 
1552
1552
  ### GET /contactdb/reserved_fields
1553
1553
 
@@ -1782,7 +1782,7 @@ puts response.headers
1782
1782
 
1783
1783
  **This endpoint allows you to retrieve a list of all assigned and unassigned IPs.**
1784
1784
 
1785
- Response includes warm up status, pools, assigned subusers, and whitelabel info. The start_date field corresponds to when warmup started for that IP.
1785
+ Response includes warm up status, pools, assigned subusers, and authentica info. The start_date field corresponds to when warmup started for that IP.
1786
1786
 
1787
1787
  A single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it.
1788
1788
 
@@ -1817,9 +1817,9 @@ puts response.headers
1817
1817
 
1818
1818
  **Each user can create up to 10 different IP pools.**
1819
1819
 
1820
- 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.
1820
+ IP Pools allow you to group your dedicated Twilio 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.
1821
1821
 
1822
- IP pools can only be used with whitelabeled IP addresses.
1822
+ IP pools can only be used with authenticated IP addresses.
1823
1823
 
1824
1824
  If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.
1825
1825
 
@@ -1839,9 +1839,9 @@ puts response.headers
1839
1839
 
1840
1840
  **This endpoint allows you to retrieve all of your IP pools.**
1841
1841
 
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.
1842
+ IP Pools allow you to group your dedicated Twilio 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
 
1844
- IP pools can only be used with whitelabeled IP addresses.
1844
+ IP pools can only be used with authenticated IP addresses.
1845
1845
 
1846
1846
  If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.
1847
1847
 
@@ -1858,9 +1858,9 @@ puts response.headers
1858
1858
 
1859
1859
  **This endpoint allows you to update the name of an IP pool.**
1860
1860
 
1861
- 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.
1861
+ IP Pools allow you to group your dedicated Twilio 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.
1862
1862
 
1863
- IP pools can only be used with whitelabeled IP addresses.
1863
+ IP pools can only be used with authenticated IP addresses.
1864
1864
 
1865
1865
  If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.
1866
1866
 
@@ -1881,9 +1881,9 @@ puts response.headers
1881
1881
 
1882
1882
  **This endpoint allows you to list all of the IP addresses that are in a specific IP pool.**
1883
1883
 
1884
- 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.
1884
+ IP Pools allow you to group your dedicated Twilio 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.
1885
1885
 
1886
- IP pools can only be used with whitelabeled IP addresses.
1886
+ IP pools can only be used with authenticated IP addresses.
1887
1887
 
1888
1888
  If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.
1889
1889
 
@@ -1901,9 +1901,9 @@ puts response.headers
1901
1901
 
1902
1902
  **This endpoint allows you to delete an IP pool.**
1903
1903
 
1904
- 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.
1904
+ IP Pools allow you to group your dedicated Twilio 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.
1905
1905
 
1906
- IP pools can only be used with whitelabeled IP addresses.
1906
+ IP pools can only be used with authenticated IP addresses.
1907
1907
 
1908
1908
  If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.
1909
1909
 
@@ -1961,7 +1961,7 @@ puts response.headers
1961
1961
 
1962
1962
  **This endpoint allows you to enter an IP address into warmup mode.**
1963
1963
 
1964
- SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how SendGrid limits your email traffic for IPs in warmup.
1964
+ Twilio SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how Twilio SendGrid limits your email traffic for IPs in warmup.
1965
1965
 
1966
1966
  For more general information about warming up IPs, please see our [Classroom](https://sendgrid.com/docs/Classroom/Deliver/Delivery_Introduction/warming_up_ips.html).
1967
1967
 
@@ -1981,7 +1981,7 @@ puts response.headers
1981
1981
 
1982
1982
  **This endpoint allows you to retrieve all of your IP addresses that are currently warming up.**
1983
1983
 
1984
- SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how SendGrid limits your email traffic for IPs in warmup.
1984
+ Twilio SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how Twilio SendGrid limits your email traffic for IPs in warmup.
1985
1985
 
1986
1986
  For more general information about warming up IPs, please see our [Classroom](https://sendgrid.com/docs/Classroom/Deliver/Delivery_Introduction/warming_up_ips.html).
1987
1987
 
@@ -1998,7 +1998,7 @@ puts response.headers
1998
1998
 
1999
1999
  **This endpoint allows you to retrieve the warmup status for a specific IP address.**
2000
2000
 
2001
- SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how SendGrid limits your email traffic for IPs in warmup.
2001
+ Twilio SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how Twilio SendGrid limits your email traffic for IPs in warmup.
2002
2002
 
2003
2003
  For more general information about warming up IPs, please see our [Classroom](https://sendgrid.com/docs/Classroom/Deliver/Delivery_Introduction/warming_up_ips.html).
2004
2004
 
@@ -2016,7 +2016,7 @@ puts response.headers
2016
2016
 
2017
2017
  **This endpoint allows you to remove an IP address from warmup mode.**
2018
2018
 
2019
- SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how SendGrid limits your email traffic for IPs in warmup.
2019
+ Twilio SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how Twilio SendGrid limits your email traffic for IPs in warmup.
2020
2020
 
2021
2021
  For more general information about warming up IPs, please see our [Classroom](https://sendgrid.com/docs/Classroom/Deliver/Delivery_Introduction/warming_up_ips.html).
2022
2022
 
@@ -2092,7 +2092,7 @@ puts response.headers
2092
2092
  ```
2093
2093
  ## v3 Mail Send
2094
2094
 
2095
- This endpoint allows you to send email over SendGrids v3 Web API, the most recent version of our API. If you are looking for documentation about the v2 Mail Send endpoint, please see our [v2 API Reference](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
2095
+ This endpoint allows you to send email over Twilio SendGrid's v3 Web API, the most recent version of our API. If you are looking for documentation about the v2 Mail Send endpoint, please see our [v2 API Reference](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
2096
2096
 
2097
2097
  * Top level parameters are referred to as "global".
2098
2098
  * Individual fields within the personalizations array will override any other global, or message level, parameters that are defined outside of personalizations.
@@ -2157,8 +2157,8 @@ data = JSON.parse('{
2157
2157
  },
2158
2158
  "footer": {
2159
2159
  "enable": true,
2160
- "html": "<p>Thanks</br>The SendGrid Team</p>",
2161
- "text": "Thanks,/n The SendGrid Team"
2160
+ "html": "<p>Thanks</br>The Twilio SendGrid Team</p>",
2161
+ "text": "Thanks,/n The Twilio SendGrid Team"
2162
2162
  },
2163
2163
  "sandbox_mode": {
2164
2164
  "enable": false
@@ -2256,7 +2256,7 @@ puts response.headers
2256
2256
 
2257
2257
  **This endpoint allows you to retrieve a list of all mail settings.**
2258
2258
 
2259
- Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2259
+ Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2260
2260
 
2261
2261
  ### GET /mail_settings
2262
2262
 
@@ -2274,7 +2274,7 @@ puts response.headers
2274
2274
 
2275
2275
  The address whitelist setting whitelists a specified email address or domain for which mail should never be suppressed. For example, you own the domain example.com, and one or more of your recipients use email@example.com addresses, by placing example.com in the address whitelist setting, all bounces, blocks, and unsubscribes logged for that domain will be ignored and sent as if under normal sending conditions.
2276
2276
 
2277
- Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2277
+ Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2278
2278
 
2279
2279
  ### PATCH /mail_settings/address_whitelist
2280
2280
 
@@ -2298,7 +2298,7 @@ puts response.headers
2298
2298
 
2299
2299
  The address whitelist setting whitelists a specified email address or domain for which mail should never be suppressed. For example, you own the domain example.com, and one or more of your recipients use email@example.com addresses, by placing example.com in the address whitelist setting, all bounces, blocks, and unsubscribes logged for that domain will be ignored and sent as if under normal sending conditions.
2300
2300
 
2301
- Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2301
+ Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2302
2302
 
2303
2303
  ### GET /mail_settings/address_whitelist
2304
2304
 
@@ -2313,9 +2313,9 @@ puts response.headers
2313
2313
 
2314
2314
  **This endpoint allows you to update your current BCC mail settings.**
2315
2315
 
2316
- When the BCC mail setting is enabled, SendGrid will automatically send a blind carbon copy (BCC) to an address for every email sent without adding that address to the header. Please note that only one email address may be entered in this field, if you wish to distribute BCCs to multiple addresses you will need to create a distribution group or use forwarding rules.
2316
+ When the BCC mail setting is enabled, Twilio SendGrid will automatically send a blind carbon copy (BCC) to an address for every email sent without adding that address to the header. Please note that only one email address may be entered in this field, if you wish to distribute BCCs to multiple addresses you will need to create a distribution group or use forwarding rules.
2317
2317
 
2318
- Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2318
+ Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2319
2319
 
2320
2320
  ### PATCH /mail_settings/bcc
2321
2321
 
@@ -2334,9 +2334,9 @@ puts response.headers
2334
2334
 
2335
2335
  **This endpoint allows you to retrieve your current BCC mail settings.**
2336
2336
 
2337
- When the BCC mail setting is enabled, SendGrid will automatically send a blind carbon copy (BCC) to an address for every email sent without adding that address to the header. Please note that only one email address may be entered in this field, if you wish to distribute BCCs to multiple addresses you will need to create a distribution group or use forwarding rules.
2337
+ When the BCC mail setting is enabled, Twilio SendGrid will automatically send a blind carbon copy (BCC) to an address for every email sent without adding that address to the header. Please note that only one email address may be entered in this field, if you wish to distribute BCCs to multiple addresses you will need to create a distribution group or use forwarding rules.
2338
2338
 
2339
- Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2339
+ Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2340
2340
 
2341
2341
  ### GET /mail_settings/bcc
2342
2342
 
@@ -2351,9 +2351,9 @@ puts response.headers
2351
2351
 
2352
2352
  **This endpoint allows you to update your current bounce purge settings.**
2353
2353
 
2354
- This setting allows you to set a schedule for SendGrid to automatically delete contacts from your soft and hard bounce suppression lists.
2354
+ This setting allows you to set a schedule for Twilio SendGrid to automatically delete contacts from your soft and hard bounce suppression lists.
2355
2355
 
2356
- Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2356
+ Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2357
2357
 
2358
2358
  ### PATCH /mail_settings/bounce_purge
2359
2359
 
@@ -2373,9 +2373,9 @@ puts response.headers
2373
2373
 
2374
2374
  **This endpoint allows you to retrieve your current bounce purge settings.**
2375
2375
 
2376
- This setting allows you to set a schedule for SendGrid to automatically delete contacts from your soft and hard bounce suppression lists.
2376
+ This setting allows you to set a schedule for Twilio SendGrid to automatically delete contacts from your soft and hard bounce suppression lists.
2377
2377
 
2378
- Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2378
+ Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2379
2379
 
2380
2380
  ### GET /mail_settings/bounce_purge
2381
2381
 
@@ -2392,7 +2392,7 @@ puts response.headers
2392
2392
 
2393
2393
  The footer setting will insert a custom footer at the bottom of the text and HTML bodies. Use the embedded HTML editor and plain text entry fields to create the content of the footers to be inserted into your emails.
2394
2394
 
2395
- Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2395
+ Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2396
2396
 
2397
2397
  ### PATCH /mail_settings/footer
2398
2398
 
@@ -2414,7 +2414,7 @@ puts response.headers
2414
2414
 
2415
2415
  The footer setting will insert a custom footer at the bottom of the text and HTML bodies. Use the embedded HTML editor and plain text entry fields to create the content of the footers to be inserted into your emails.
2416
2416
 
2417
- Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2417
+ Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2418
2418
 
2419
2419
  ### GET /mail_settings/footer
2420
2420
 
@@ -2431,7 +2431,7 @@ puts response.headers
2431
2431
 
2432
2432
  Activating this setting allows you to specify an email address to which bounce reports are forwarded.
2433
2433
 
2434
- Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2434
+ Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2435
2435
 
2436
2436
  ### PATCH /mail_settings/forward_bounce
2437
2437
 
@@ -2452,7 +2452,7 @@ puts response.headers
2452
2452
 
2453
2453
  Activating this setting allows you to specify an email address to which bounce reports are forwarded.
2454
2454
 
2455
- Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2455
+ Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2456
2456
 
2457
2457
  ### GET /mail_settings/forward_bounce
2458
2458
 
@@ -2469,7 +2469,7 @@ puts response.headers
2469
2469
 
2470
2470
  Enabling the forward spam setting allows you to specify an email address to which spam reports will be forwarded.
2471
2471
 
2472
- Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2472
+ Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2473
2473
 
2474
2474
  ### PATCH /mail_settings/forward_spam
2475
2475
 
@@ -2490,7 +2490,7 @@ puts response.headers
2490
2490
 
2491
2491
  Enabling the forward spam setting allows you to specify an email address to which spam reports will be forwarded.
2492
2492
 
2493
- Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2493
+ Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2494
2494
 
2495
2495
  ### GET /mail_settings/forward_spam
2496
2496
 
@@ -2507,7 +2507,7 @@ puts response.headers
2507
2507
 
2508
2508
  The plain content setting will automatically convert any plain text emails that you send to HTML before sending.
2509
2509
 
2510
- Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2510
+ Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2511
2511
 
2512
2512
  ### PATCH /mail_settings/plain_content
2513
2513
 
@@ -2527,7 +2527,7 @@ puts response.headers
2527
2527
 
2528
2528
  The plain content setting will automatically convert any plain text emails that you send to HTML before sending.
2529
2529
 
2530
- Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2530
+ Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2531
2531
 
2532
2532
  ### GET /mail_settings/plain_content
2533
2533
 
@@ -2544,7 +2544,7 @@ puts response.headers
2544
2544
 
2545
2545
  The spam checker filter notifies you when emails are detected that exceed a predefined spam threshold.
2546
2546
 
2547
- Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2547
+ Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2548
2548
 
2549
2549
  ### PATCH /mail_settings/spam_check
2550
2550
 
@@ -2566,7 +2566,7 @@ puts response.headers
2566
2566
 
2567
2567
  The spam checker filter notifies you when emails are detected that exceed a predefined spam threshold.
2568
2568
 
2569
- Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2569
+ Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2570
2570
 
2571
2571
  ### GET /mail_settings/spam_check
2572
2572
 
@@ -2585,7 +2585,7 @@ This setting refers to our original email templates. We currently support more f
2585
2585
 
2586
2586
  The legacy email template setting wraps an HTML template around your email content. This can be useful for sending out marketing email and/or other HTML formatted messages.
2587
2587
 
2588
- Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2588
+ Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2589
2589
 
2590
2590
  ### PATCH /mail_settings/template
2591
2591
 
@@ -2608,7 +2608,7 @@ This setting refers to our original email templates. We currently support more f
2608
2608
 
2609
2609
  The legacy email template setting wraps an HTML template around your email content. This can be useful for sending out marketing email and/or other HTML formatted messages.
2610
2610
 
2611
- Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2611
+ Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
2612
2612
 
2613
2613
  ### GET /mail_settings/template
2614
2614
 
@@ -2647,7 +2647,7 @@ puts response.headers
2647
2647
 
2648
2648
  **This endpoint allows you to retrieve a list of all partner settings that you can enable.**
2649
2649
 
2650
- Our partner settings allow you to integrate your SendGrid account with our partners to increase your SendGrid experience and functionality. For more information about our partners, and how you can begin integrating with them, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/partners.html).
2650
+ Our partner settings allow you to integrate your Twilio SendGrid account with our partners to increase your Twilio SendGrid experience and functionality. For more information about our partners, and how you can begin integrating with them, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/partners.html).
2651
2651
 
2652
2652
  ### GET /partner_settings
2653
2653
 
@@ -2663,9 +2663,9 @@ puts response.headers
2663
2663
 
2664
2664
  **This endpoint allows you to update or change your New Relic partner settings.**
2665
2665
 
2666
- Our partner settings allow you to integrate your SendGrid account with our partners to increase your SendGrid experience and functionality. For more information about our partners, and how you can begin integrating with them, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/partners.html).
2666
+ Our partner settings allow you to integrate your Twilio SendGrid account with our partners to increase your Twilio SendGrid experience and functionality. For more information about our partners, and how you can begin integrating with them, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/partners.html).
2667
2667
 
2668
- By integrating with New Relic, you can send your SendGrid email statistics to your New Relic Dashboard. If you enable this setting, your stats will be sent to New Relic every 5 minutes. You will need your New Relic License Key to enable this setting. For more information, please see our [Classroom](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/new_relic.html).
2668
+ By integrating with New Relic, you can send your Twilio SendGrid email statistics to your New Relic Dashboard. If you enable this setting, your stats will be sent to New Relic every 5 minutes. You will need your New Relic License Key to enable this setting. For more information, please see our [Classroom](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/new_relic.html).
2669
2669
 
2670
2670
  ### PATCH /partner_settings/new_relic
2671
2671
 
@@ -2685,9 +2685,9 @@ puts response.headers
2685
2685
 
2686
2686
  **This endpoint allows you to retrieve your current New Relic partner settings.**
2687
2687
 
2688
- Our partner settings allow you to integrate your SendGrid account with our partners to increase your SendGrid experience and functionality. For more information about our partners, and how you can begin integrating with them, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/partners.html).
2688
+ Our partner settings allow you to integrate your Twilio SendGrid account with our partners to increase your Twilio SendGrid experience and functionality. For more information about our partners, and how you can begin integrating with them, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/partners.html).
2689
2689
 
2690
- By integrating with New Relic, you can send your SendGrid email statistics to your New Relic Dashboard. If you enable this setting, your stats will be sent to New Relic every 5 minutes. You will need your New Relic License Key to enable this setting. For more information, please see our [Classroom](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/new_relic.html).
2690
+ By integrating with New Relic, you can send your Twilio SendGrid email statistics to your New Relic Dashboard. If you enable this setting, your stats will be sent to New Relic every 5 minutes. You will need your New Relic License Key to enable this setting. For more information, please see our [Classroom](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/new_relic.html).
2691
2691
 
2692
2692
  ### GET /partner_settings/new_relic
2693
2693
 
@@ -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 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).
2708
+ API Keys can be used to authenticate the use of [Twilio SendGrid's 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
 
@@ -2725,7 +2725,7 @@ puts response.headers
2725
2725
 
2726
2726
  *You may create up to 100 unique sender identities.*
2727
2727
 
2728
- 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`.
2728
+ Sender Identities are required to be verified before use. If your domain has been authenticated, it will auto verify on creation. Otherwise an email will be sent to the `from.email`.
2729
2729
 
2730
2730
  ### POST /senders
2731
2731
 
@@ -2757,7 +2757,7 @@ puts response.headers
2757
2757
 
2758
2758
  **This endpoint allows you to retrieve a list of all sender identities that have been created for your account.**
2759
2759
 
2760
- 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`.
2760
+ Sender Identities are required to be verified before use. If your domain has been authenticated, it will auto verify on creation. Otherwise an email will be sent to the `from.email`.
2761
2761
 
2762
2762
  ### GET /senders
2763
2763
 
@@ -2772,7 +2772,7 @@ puts response.headers
2772
2772
 
2773
2773
  **This endpoint allows you to update a sender identity.**
2774
2774
 
2775
- Updates to `from.email` require re-verification. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`.
2775
+ Updates to `from.email` require re-verification. If your domain has been authenticated, it will auto verify on creation. Otherwise an email will be sent to the `from.email`.
2776
2776
 
2777
2777
  Partial updates are allowed, but fields that are marked as "required" in the POST (create) endpoint must not be nil if that field is included in the PATCH request.
2778
2778
 
@@ -2807,7 +2807,7 @@ puts response.headers
2807
2807
 
2808
2808
  **This endpoint allows you to retrieve a specific sender identity.**
2809
2809
 
2810
- 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`.
2810
+ Sender Identities are required to be verified before use. If your domain has been authenticated, it will auto verify on creation. Otherwise an email will be sent to the `from.email`.
2811
2811
 
2812
2812
  ### GET /senders/{sender_id}
2813
2813
 
@@ -2823,7 +2823,7 @@ puts response.headers
2823
2823
 
2824
2824
  **This endpoint allows you to delete one of your sender identities.**
2825
2825
 
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`.
2826
+ Sender Identities are required to be verified before use. If your domain has been authenticated, it will auto verify on creation. Otherwise an email will be sent to the `from.email`.
2827
2827
 
2828
2828
  ### DELETE /senders/{sender_id}
2829
2829
 
@@ -2839,7 +2839,7 @@ puts response.headers
2839
2839
 
2840
2840
  **This endpoint allows you to resend a sender identity verification email.**
2841
2841
 
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`.
2842
+ Sender Identities are required to be verified before use. If your domain has been authenticated, it will auto verify on creation. Otherwise an email will be sent to the `from.email`.
2843
2843
 
2844
2844
  ### POST /senders/{sender_id}/resend_verification
2845
2845
 
@@ -2851,2184 +2851,2186 @@ puts response.status_code
2851
2851
  puts response.body
2852
2852
  puts response.headers
2853
2853
  ```
2854
- <a name="stats"></a>
2855
- # STATS
2856
-
2857
- ## Retrieve global email statistics
2858
-
2859
- **This endpoint allows you to retrieve all of your global email statistics between a given date range.**
2860
-
2861
- Parent accounts will see aggregated stats for their account and all subuser accounts. Subuser accounts will only see their own stats.
2862
-
2863
- ### GET /stats
2864
2854
 
2855
+ <a name="sender-authentication"></a>
2856
+ # SENDER AUTHENTICATION
2865
2857
 
2866
- ```ruby
2867
- params = JSON.parse('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}')
2868
- response = sg.client.stats.get(query_params: params)
2869
- puts response.status_code
2870
- puts response.body
2871
- puts response.headers
2872
- ```
2873
- <a name="subusers"></a>
2874
- # SUBUSERS
2858
+ ## Create an authenticated domain.
2875
2859
 
2876
- ## Create Subuser
2860
+ **This endpoint allows you to create a domain authentication for one of your domains.**
2877
2861
 
2878
- This endpoint allows you to retrieve a list of all of your subusers. You can choose to retrieve specific subusers as well as limit the results that come back from the API.
2862
+ If you are creating a domain authentication that you would like a subuser to use, you have two options:
2863
+ 1. Use the "username" parameter. This allows you to create am authenticated subuser. This means the subuser is able to see and modify the created authentication.
2864
+ 2. Use the Association workflow (see Associate Domain section). This allows you to assign a domain authentication created by the parent to a subuser. This means the subuser will default to the assigned domain authentication, but will not be able to see or modify that authentication. However, if the subuser creates their own domain authentication it will overwrite the assigned domain authentication.
2879
2865
 
2880
- For more information about Subusers:
2866
+ A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio 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.
2881
2867
 
2882
- * [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)
2883
- * [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)
2868
+ For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
2884
2869
 
2885
- ### POST /subusers
2870
+ ### POST /whitelabel/domains
2886
2871
 
2887
2872
 
2888
2873
  ```ruby
2889
2874
  data = JSON.parse('{
2890
- "email": "John@example.com",
2875
+ "automatic_security": false,
2876
+ "custom_spf": true,
2877
+ "default": true,
2878
+ "domain": "example.com",
2891
2879
  "ips": [
2892
- "1.1.1.1",
2893
- "2.2.2.2"
2880
+ "192.168.1.1",
2881
+ "192.168.1.2"
2894
2882
  ],
2895
- "password": "johns_password",
2896
- "username": "John@example.com"
2883
+ "subdomain": "news",
2884
+ "username": "john@example.com"
2897
2885
  }')
2898
- response = sg.client.subusers.post(request_body: data)
2886
+ response = sg.client.whitelabel.domains.post(request_body: data)
2899
2887
  puts response.status_code
2900
2888
  puts response.body
2901
2889
  puts response.headers
2902
2890
  ```
2903
- ## List all Subusers
2904
-
2905
- This endpoint allows you to retrieve a list of all of your subusers. You can choose to retrieve specific subusers as well as limit the results that come back from the API.
2906
-
2907
- For more information about Subusers:
2908
-
2909
- * [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)
2910
- * [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)
2911
-
2912
- ### GET /subusers
2891
+ ## List all domain authentications.
2913
2892
 
2893
+ **This endpoint allows you to retrieve a list of all domain authentications you have created.**
2914
2894
 
2915
- ```ruby
2916
- params = JSON.parse('{"username": "test_string", "limit": 1, "offset": 1}')
2917
- response = sg.client.subusers.get(query_params: params)
2918
- puts response.status_code
2919
- puts response.body
2920
- puts response.headers
2921
- ```
2922
- ## Retrieve Subuser Reputations
2895
+ A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio 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.
2923
2896
 
2924
- Subuser sender reputations give a good idea how well a sender is doing with regards to how recipients and recipient servers react to the mail that is being received. When a bounce, spam report, or other negative action happens on a sent email, it will effect your sender rating.
2897
+ For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
2925
2898
 
2926
- This endpoint allows you to request the reputations for your subusers.
2927
2899
 
2928
- ### GET /subusers/reputations
2900
+ ### GET /whitelabel/domains
2929
2901
 
2930
2902
 
2931
2903
  ```ruby
2932
- params = JSON.parse('{"usernames": "test_string"}')
2933
- response = sg.client.subusers.reputations.get(query_params: params)
2904
+ params = JSON.parse('{"username": "test_string", "domain": "test_string", "exclude_subusers": "true", "limit": 1, "offset": 1}')
2905
+ response = sg.client.whitelabel.domains.get(query_params: params)
2934
2906
  puts response.status_code
2935
2907
  puts response.body
2936
2908
  puts response.headers
2937
2909
  ```
2938
- ## Retrieve email statistics for your subusers.
2910
+ ## Get the default domain authentication.
2939
2911
 
2940
- **This endpoint allows you to retrieve the email statistics for the given subusers.**
2912
+ **This endpoint allows you to retrieve the default authentication for a domain.**
2941
2913
 
2942
- You may retrieve statistics for up to 10 different subusers by including an additional _subusers_ parameter for each additional subuser.
2914
+ A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio 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.
2943
2915
 
2944
- 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. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings.
2916
+ For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
2945
2917
 
2946
- For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).
2918
+ ## URI Parameters
2919
+ | URI Parameter | Type | Description |
2920
+ |---|---|---|
2921
+ | domain | string |The domain to find a default domain whitelabel for. |
2947
2922
 
2948
- ### GET /subusers/stats
2923
+ ### GET /whitelabel/domains/default
2949
2924
 
2950
2925
 
2951
2926
  ```ruby
2952
- params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01", "subusers": "test_string"}')
2953
- response = sg.client.subusers.stats.get(query_params: params)
2927
+ response = sg.client.whitelabel.domains.default.get()
2954
2928
  puts response.status_code
2955
2929
  puts response.body
2956
2930
  puts response.headers
2957
2931
  ```
2958
- ## Retrieve monthly stats for all subusers
2932
+ ## List the domain authentication associated with the given user.
2959
2933
 
2960
- **This endpoint allows you to retrieve the monthly email statistics for all subusers over the given date range.**
2934
+ **This endpoint allows you to retrieve all of the domain authentications that have been assigned to a specific subuser.**
2961
2935
 
2962
- 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.
2936
+ A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio 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.
2963
2937
 
2964
- When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics:
2965
- `bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`.
2938
+ Domain authentications can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's authenticated domains. To associate a domain authentication with a subuser, the parent account must first create the domain authentication and validate it. The parent may then associate the domain authentication via the subuser management tools.
2966
2939
 
2967
- For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).
2940
+ For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
2968
2941
 
2969
- ### GET /subusers/stats/monthly
2942
+ ## URI Parameters
2943
+ | URI Parameter | Type | Description |
2944
+ |---|---|---|
2945
+ | username | string | Username of the subuser to find associated whitelabels for. |
2946
+
2947
+ ### GET /whitelabel/domains/subuser
2970
2948
 
2971
2949
 
2972
2950
  ```ruby
2973
- params = JSON.parse('{"subuser": "test_string", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "date": "test_string", "sort_by_direction": "asc"}')
2974
- response = sg.client.subusers.stats.monthly.get(query_params: params)
2951
+ response = sg.client.whitelabel.domains.subuser.get()
2975
2952
  puts response.status_code
2976
2953
  puts response.body
2977
2954
  puts response.headers
2978
2955
  ```
2979
- ## Retrieve the totals for each email statistic metric for all subusers.
2956
+ ## Disassociate a domain authentication from a given user.
2980
2957
 
2981
- **This endpoint allows you to retrieve the total sums of each email statistic metric for all subusers over the given date range.**
2958
+ **This endpoint allows you to disassociate a specific domain authentication from a subuser.**
2982
2959
 
2960
+ A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio 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.
2983
2961
 
2984
- 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. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings.
2962
+ Domain authentications can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's authenticated domains. To associate a domain authentication with a subuser, the parent account must first create the domain authentication and validate it. The parent may then associate the domain authentication via the subuser management tools.
2985
2963
 
2986
- For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).
2964
+ For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
2987
2965
 
2988
- ### GET /subusers/stats/sums
2966
+ ## URI Parameters
2967
+ | URI Parameter | Type | Required? | Description |
2968
+ |---|---|---|---|
2969
+ | username | string | required | Username for the subuser to find associated whitelabels for. |
2970
+
2971
+ ### DELETE /whitelabel/domains/subuser
2989
2972
 
2990
2973
 
2991
2974
  ```ruby
2992
- params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "start_date": "2016-01-01", "sort_by_direction": "asc"}')
2993
- response = sg.client.subusers.stats.sums.get(query_params: params)
2975
+ response = sg.client.whitelabel.domains.subuser.delete()
2994
2976
  puts response.status_code
2995
2977
  puts response.body
2996
2978
  puts response.headers
2997
2979
  ```
2998
- ## Enable/disable a subuser
2980
+ ## Update a domain authentication.
2999
2981
 
3000
- This endpoint allows you to enable or disable a subuser.
2982
+ **This endpoint allows you to update the settings for a domain authentication.**
3001
2983
 
3002
- For more information about Subusers:
2984
+ A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio 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.
3003
2985
 
3004
- * [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)
3005
- * [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)
2986
+ For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
3006
2987
 
3007
- ### PATCH /subusers/{subuser_name}
2988
+ ### PATCH /whitelabel/domains/{domain_id}
3008
2989
 
3009
2990
 
3010
2991
  ```ruby
3011
2992
  data = JSON.parse('{
3012
- "disabled": false
2993
+ "custom_spf": true,
2994
+ "default": false
3013
2995
  }')
3014
- subuser_name = "test_url_param"
3015
- response = sg.client.subusers._(subuser_name).patch(request_body: data)
2996
+ domain_id = "test_url_param"
2997
+ response = sg.client.whitelabel.domains._(domain_id).patch(request_body: data)
3016
2998
  puts response.status_code
3017
2999
  puts response.body
3018
3000
  puts response.headers
3019
3001
  ```
3020
- ## Delete a subuser
3002
+ ## Retrieve a domain authentication.
3021
3003
 
3022
- This endpoint allows you to delete a subuser. This is a permanent action, once deleted a subuser cannot be retrieved.
3004
+ **This endpoint allows you to retrieve a specific domain authentication.**
3023
3005
 
3024
- For more information about Subusers:
3006
+ A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio 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.
3025
3007
 
3026
- * [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)
3027
- * [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)
3008
+ For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
3028
3009
 
3029
- ### DELETE /subusers/{subuser_name}
3010
+
3011
+ ### GET /whitelabel/domains/{domain_id}
3030
3012
 
3031
3013
 
3032
3014
  ```ruby
3033
- subuser_name = "test_url_param"
3034
- response = sg.client.subusers._(subuser_name).delete()
3015
+ domain_id = "test_url_param"
3016
+ response = sg.client.whitelabel.domains._(domain_id).get()
3035
3017
  puts response.status_code
3036
3018
  puts response.body
3037
3019
  puts response.headers
3038
3020
  ```
3039
- ## Update IPs assigned to a subuser
3021
+ ## Delete a domain authentication.
3040
3022
 
3041
- Each subuser should be assigned to an IP address, from which all of this subuser's mail will be sent. Often, this is the same IP as the parent account, but each subuser can have their own, or multiple, IP addresses as well.
3023
+ **This endpoint allows you to delete a domain authentication.**
3042
3024
 
3043
- More information:
3025
+ A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio 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.
3044
3026
 
3045
- * [How to request more IPs](https://sendgrid.com/docs/Classroom/Basics/Account/adding_an_additional_dedicated_ip_to_your_account.html)
3046
- * [IPs can be whitelabeled](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/ips.html)
3027
+ For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
3047
3028
 
3048
- ### PUT /subusers/{subuser_name}/ips
3029
+ ### DELETE /whitelabel/domains/{domain_id}
3049
3030
 
3050
3031
 
3051
3032
  ```ruby
3052
- data = JSON.parse('[
3053
- "127.0.0.1"
3054
- ]')
3055
- subuser_name = "test_url_param"
3056
- response = sg.client.subusers._(subuser_name).ips.put(request_body: data)
3033
+ domain_id = "test_url_param"
3034
+ response = sg.client.whitelabel.domains._(domain_id).delete()
3057
3035
  puts response.status_code
3058
3036
  puts response.body
3059
3037
  puts response.headers
3060
3038
  ```
3061
- ## Update Monitor Settings for a subuser
3039
+ ## Associate a domain authentication with a given user.
3062
3040
 
3063
- Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.
3041
+ **This endpoint allows you to associate a specific domain authentication with a subuser.**
3064
3042
 
3065
- ### PUT /subusers/{subuser_name}/monitor
3043
+ A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio 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.
3044
+
3045
+ Domain authentications can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's authenticated domains. To associate a domain authentication with a subuser, the parent account must first create the domain authentication and validate it. The parent may then associate the domain authentication via the subuser management tools.
3046
+
3047
+ For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
3048
+
3049
+ ## URI Parameters
3050
+ | URI Parameter | Type | Description |
3051
+ |---|---|---|
3052
+ | domain_id | integer | ID of the domain whitelabel to associate with the subuser. |
3053
+
3054
+ ### POST /whitelabel/domains/{domain_id}/subuser
3066
3055
 
3067
3056
 
3068
3057
  ```ruby
3069
3058
  data = JSON.parse('{
3070
- "email": "example@example.com",
3071
- "frequency": 500
3059
+ "username": "jane@example.com"
3072
3060
  }')
3073
- subuser_name = "test_url_param"
3074
- response = sg.client.subusers._(subuser_name).monitor.put(request_body: data)
3061
+ domain_id = "test_url_param"
3062
+ response = sg.client.whitelabel.domains._(domain_id).subuser.post(request_body: data)
3075
3063
  puts response.status_code
3076
3064
  puts response.body
3077
3065
  puts response.headers
3078
3066
  ```
3079
- ## Create monitor settings
3067
+ ## Add an IP to a domain authentication.
3080
3068
 
3081
- Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.
3069
+ **This endpoint allows you to add an IP address to a domain authentication.**
3082
3070
 
3083
- ### POST /subusers/{subuser_name}/monitor
3071
+ A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio 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.
3072
+
3073
+ For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
3074
+
3075
+ ## URI Parameters
3076
+ | URI Parameter | Type | Description |
3077
+ |---|---|---|
3078
+ | id | integer | ID of the domain to which you are adding an IP |
3079
+
3080
+ ### POST /whitelabel/domains/{id}/ips
3084
3081
 
3085
3082
 
3086
3083
  ```ruby
3087
3084
  data = JSON.parse('{
3088
- "email": "example@example.com",
3089
- "frequency": 50000
3085
+ "ip": "192.168.0.1"
3090
3086
  }')
3091
- subuser_name = "test_url_param"
3092
- response = sg.client.subusers._(subuser_name).monitor.post(request_body: data)
3087
+ id = "test_url_param"
3088
+ response = sg.client.whitelabel.domains._(id).ips.post(request_body: data)
3093
3089
  puts response.status_code
3094
3090
  puts response.body
3095
3091
  puts response.headers
3096
3092
  ```
3097
- ## Retrieve monitor settings for a subuser
3093
+ ## Remove an IP from a domain authenticaiton.
3098
3094
 
3099
- Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.
3095
+ **This endpoint allows you to remove a domain's IP address from that domain's authentication.**
3100
3096
 
3101
- ### GET /subusers/{subuser_name}/monitor
3097
+ A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio 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.
3098
+
3099
+ For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
3100
+
3101
+ ## URI Parameters
3102
+ | URI Parameter | Type | Description |
3103
+ |---|---|---|
3104
+ | id | integer | ID of the domain whitelabel to delete the IP from. |
3105
+ | ip | string | IP to remove from the domain whitelabel. |
3106
+
3107
+ ### DELETE /whitelabel/domains/{id}/ips/{ip}
3102
3108
 
3103
3109
 
3104
3110
  ```ruby
3105
- subuser_name = "test_url_param"
3106
- response = sg.client.subusers._(subuser_name).monitor.get()
3111
+ id = "test_url_param"
3112
+ ip = "test_url_param"
3113
+ response = sg.client.whitelabel.domains._(id).ips._(ip).delete()
3107
3114
  puts response.status_code
3108
3115
  puts response.body
3109
3116
  puts response.headers
3110
3117
  ```
3111
- ## Delete monitor settings
3118
+ ## Validate a domain authentication.
3112
3119
 
3113
- Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.
3120
+ **This endpoint allows you to validate a domain authentication. If it fails, it will return an error message describing why the domain could not be validated.**
3114
3121
 
3115
- ### DELETE /subusers/{subuser_name}/monitor
3122
+ A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio 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.
3123
+
3124
+ For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
3125
+
3126
+ ## URI Parameters
3127
+ | URI Parameter | Type | Description |
3128
+ |---|---|---|
3129
+ | id | integer |ID of the domain whitelabel to validate. |
3130
+
3131
+ ### POST /whitelabel/domains/{id}/validate
3116
3132
 
3117
3133
 
3118
3134
  ```ruby
3119
- subuser_name = "test_url_param"
3120
- response = sg.client.subusers._(subuser_name).monitor.delete()
3135
+ id = "test_url_param"
3136
+ response = sg.client.whitelabel.domains._(id).validate.post()
3121
3137
  puts response.status_code
3122
3138
  puts response.body
3123
3139
  puts response.headers
3124
3140
  ```
3125
- ## Retrieve the monthly email statistics for a single subuser
3141
+ ## Create reverse DNS record
3126
3142
 
3127
- **This endpoint allows you to retrieve the monthly email statistics for a specific subuser.**
3143
+ **This endpoint allows you to create a reverse DNS record.**
3128
3144
 
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.
3145
+ When creating a reverse DNS record, you should use the same subdomain that you used when you created a domain authentication.
3130
3146
 
3131
- When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics:
3132
- `bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`.
3147
+ Reverse DNS consists of a subdomain and domain that will be used to generate a record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.
3133
3148
 
3134
- For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).
3149
+ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/).
3135
3150
 
3136
- ### GET /subusers/{subuser_name}/stats/monthly
3151
+ ### POST /whitelabel/ips
3137
3152
 
3138
3153
 
3139
3154
  ```ruby
3140
- params = JSON.parse('{"date": "test_string", "sort_by_direction": "asc", "limit": 1, "sort_by_metric": "test_string", "offset": 1}')
3141
- subuser_name = "test_url_param"
3142
- response = sg.client.subusers._(subuser_name).stats.monthly.get(query_params: params)
3155
+ data = JSON.parse('{
3156
+ "domain": "example.com",
3157
+ "ip": "192.168.1.1",
3158
+ "subdomain": "email"
3159
+ }')
3160
+ response = sg.client.whitelabel.ips.post(request_body: data)
3143
3161
  puts response.status_code
3144
3162
  puts response.body
3145
3163
  puts response.headers
3146
3164
  ```
3147
- <a name="suppression"></a>
3148
- # SUPPRESSION
3165
+ ## Retrieve all reverse DNS records
3149
3166
 
3150
- ## Retrieve all blocks
3167
+ **This endpoint allows you to retrieve all of the reverse DNS records that have been created by this account.**
3151
3168
 
3152
- **This endpoint allows you to retrieve a list of all email addresses that are currently on your blocks list.**
3169
+ 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.").
3153
3170
 
3154
- [Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server.
3171
+ Reverse DNS consists of a subdomain and domain that will be used to generate a record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.
3155
3172
 
3156
- For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).
3173
+ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/).
3157
3174
 
3158
- ### GET /suppression/blocks
3175
+ ### GET /whitelabel/ips
3159
3176
 
3160
3177
 
3161
3178
  ```ruby
3162
- params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
3163
- response = sg.client.suppression.blocks.get(query_params: params)
3179
+ params = JSON.parse('{"ip": "test_string", "limit": 1, "offset": 1}')
3180
+ response = sg.client.whitelabel.ips.get(query_params: params)
3164
3181
  puts response.status_code
3165
3182
  puts response.body
3166
3183
  puts response.headers
3167
3184
  ```
3168
- ## Delete blocks
3185
+ ## Retrieve an reverse DNS record
3169
3186
 
3170
- **This endpoint allows you to delete all email addresses on your blocks list.**
3187
+ **This endpoint allows you to retrieve a reverse DNS record.**
3171
3188
 
3172
- There are two options for deleting blocked emails:
3189
+ Reverse DNS consists of a subdomain and domain that will be used to generate a record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.
3173
3190
 
3174
- 1. You can delete all blocked emails by setting `delete_all` to true in the request body.
3175
- 2. You can delete some blocked emails by specifying the email addresses in an array in the request body.
3191
+ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/).
3176
3192
 
3177
- [Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server.
3178
-
3179
- For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).
3180
-
3181
- ### DELETE /suppression/blocks
3193
+ ### GET /whitelabel/ips/{id}
3182
3194
 
3183
3195
 
3184
3196
  ```ruby
3185
- data = JSON.parse('{
3186
- "delete_all": false,
3187
- "emails": [
3188
- "example1@example.com",
3189
- "example2@example.com"
3190
- ]
3191
- }')
3192
- response = sg.client.suppression.blocks.delete(request_body: data)
3197
+ id = "test_url_param"
3198
+ response = sg.client.whitelabel.ips._(id).get()
3193
3199
  puts response.status_code
3194
3200
  puts response.body
3195
3201
  puts response.headers
3196
3202
  ```
3197
- ## Retrieve a specific block
3203
+ ## Delete an reverse DNS record
3198
3204
 
3199
- **This endpoint allows you to retrieve a specific email address from your blocks list.**
3205
+ **This endpoint allows you to delete a reverse DNS record.**
3200
3206
 
3201
- [Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server.
3207
+ Reverse DNS consists of a subdomain and domain that will be used to generate a record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.
3202
3208
 
3203
- For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).
3209
+ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/).
3204
3210
 
3205
- ### GET /suppression/blocks/{email}
3211
+ ### DELETE /whitelabel/ips/{id}
3206
3212
 
3207
3213
 
3208
3214
  ```ruby
3209
- email = "test_url_param"
3210
- response = sg.client.suppression.blocks._(email).get()
3215
+ id = "test_url_param"
3216
+ response = sg.client.whitelabel.ips._(id).delete()
3211
3217
  puts response.status_code
3212
3218
  puts response.body
3213
3219
  puts response.headers
3214
3220
  ```
3215
- ## Delete a specific block
3221
+ ## Validate a reverse DNS record
3216
3222
 
3217
- **This endpoint allows you to delete a specific email address from your blocks list.**
3223
+ **This endpoint allows you to validate a reverse DNS record.**
3218
3224
 
3219
- [Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server.
3225
+ Reverse DNS consists of a subdomain and domain that will be used to generate a record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.
3220
3226
 
3221
- For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).
3227
+ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/).
3222
3228
 
3223
- ### DELETE /suppression/blocks/{email}
3229
+ ### POST /whitelabel/ips/{id}/validate
3224
3230
 
3225
3231
 
3226
3232
  ```ruby
3227
- email = "test_url_param"
3228
- response = sg.client.suppression.blocks._(email).delete()
3233
+ id = "test_url_param"
3234
+ response = sg.client.whitelabel.ips._(id).validate.post()
3229
3235
  puts response.status_code
3230
3236
  puts response.body
3231
3237
  puts response.headers
3232
3238
  ```
3233
- ## Retrieve all bounces
3234
-
3235
- **This endpoint allows you to retrieve all of your bounces.**
3239
+ ## Create a Branded Link
3236
3240
 
3237
- Bounces are messages that are returned to the server that sent it.
3241
+ **This endpoint allows you to create a new link branding.**
3238
3242
 
3239
- For more information see:
3243
+ Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
3240
3244
 
3241
- * [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information
3242
- * [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
3245
+ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
3243
3246
 
3244
- ### GET /suppression/bounces
3247
+ ### POST /whitelabel/links
3245
3248
 
3246
3249
 
3247
3250
  ```ruby
3248
- params = JSON.parse('{"start_time": 1, "end_time": 1}')
3249
- response = sg.client.suppression.bounces.get(query_params: params)
3251
+ data = JSON.parse('{
3252
+ "default": true,
3253
+ "domain": "example.com",
3254
+ "subdomain": "mail"
3255
+ }')
3256
+ params = JSON.parse('{"limit": 1, "offset": 1}')
3257
+ response = sg.client.whitelabel.links.post(request_body: data, query_params: params)
3250
3258
  puts response.status_code
3251
3259
  puts response.body
3252
3260
  puts response.headers
3253
3261
  ```
3254
- ## Delete bounces
3255
-
3256
- **This endpoint allows you to delete all of your bounces. You can also use this endpoint to remove a specific email address from your bounce list.**
3257
-
3258
- Bounces are messages that are returned to the server that sent it.
3262
+ ## Retrieve all link brandings
3259
3263
 
3260
- For more information see:
3264
+ **This endpoint allows you to retrieve all link brandings.**
3261
3265
 
3262
- * [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information
3263
- * [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
3264
- * [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html)
3266
+ Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
3265
3267
 
3266
- Note: the `delete_all` and `emails` parameters should be used independently of each other as they have different purposes.
3268
+ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
3267
3269
 
3268
- ### DELETE /suppression/bounces
3270
+ ### GET /whitelabel/links
3269
3271
 
3270
3272
 
3271
3273
  ```ruby
3272
- data = JSON.parse('{
3273
- "delete_all": true,
3274
- "emails": [
3275
- "example@example.com",
3276
- "example2@example.com"
3277
- ]
3278
- }')
3279
- response = sg.client.suppression.bounces.delete(request_body: data)
3274
+ params = JSON.parse('{"limit": 1}')
3275
+ response = sg.client.whitelabel.links.get(query_params: params)
3280
3276
  puts response.status_code
3281
3277
  puts response.body
3282
3278
  puts response.headers
3283
3279
  ```
3284
- ## Retrieve a Bounce
3280
+ ## Retrieve a Default Link Branding
3285
3281
 
3286
- **This endpoint allows you to retrieve a specific bounce for a given email address.**
3282
+ **This endpoint allows you to retrieve the default link branding.**
3287
3283
 
3288
- Bounces are messages that are returned to the server that sent it.
3284
+ Default link branding is the actual link branding to be used when sending messages. If there are multiple link brandings, the default is determined by the following order:
3285
+ <ul>
3286
+ <li>Validated link branding marked as "default"</li>
3287
+ <li>Legacy link brands (migrated from the whitelabel wizard)</li>
3288
+ <li>Default Twilio SendGrid link whitelabel (i.e. 100.ct.sendgrid.net)</li>
3289
+ </ul>
3289
3290
 
3290
- For more information see:
3291
+ Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
3291
3292
 
3292
- * [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information
3293
- * [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
3294
- * [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html)
3293
+ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
3295
3294
 
3296
- ### GET /suppression/bounces/{email}
3295
+ ### GET /whitelabel/links/default
3297
3296
 
3298
3297
 
3299
3298
  ```ruby
3300
- email = "test_url_param"
3301
- response = sg.client.suppression.bounces._(email).get()
3299
+ params = JSON.parse('{"domain": "test_string"}')
3300
+ response = sg.client.whitelabel.links.default.get(query_params: params)
3302
3301
  puts response.status_code
3303
3302
  puts response.body
3304
3303
  puts response.headers
3305
3304
  ```
3306
- ## Delete a bounce
3305
+ ## Retrieve Associated Link Branding
3307
3306
 
3308
- **This endpoint allows you to remove an email address from your bounce list.**
3307
+ **This endpoint allows you to retrieve the associated link branding for a subuser.**
3309
3308
 
3310
- Bounces are messages that are returned to the server that sent it. This endpoint allows you to delete a single email addresses from your bounce list.
3309
+ Link branding can be associated with subusers from the parent account. This functionality allows
3310
+ subusers to send mail using their parent's link brands. To associate a link branding, the parent account
3311
+ must first create a branded link and validate it. The parent may then associate that branded link with a subuser via the API or the Subuser Management page in the user interface.
3311
3312
 
3312
- For more information see:
3313
+ Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
3313
3314
 
3314
- * [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information
3315
- * [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
3316
- * [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html)
3315
+ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
3317
3316
 
3318
- ### DELETE /suppression/bounces/{email}
3317
+ ### GET /whitelabel/links/subuser
3319
3318
 
3320
3319
 
3321
3320
  ```ruby
3322
- params = JSON.parse('{"email_address": "example@example.com"}')
3323
- email = "test_url_param"
3324
- response = sg.client.suppression.bounces._(email).delete(query_params: params)
3321
+ params = JSON.parse('{"username": "test_string"}')
3322
+ response = sg.client.whitelabel.links.subuser.get(query_params: params)
3325
3323
  puts response.status_code
3326
3324
  puts response.body
3327
3325
  puts response.headers
3328
3326
  ```
3329
- ## Retrieve all invalid emails
3327
+ ## Disassociate a Link Branding
3330
3328
 
3331
- **This endpoint allows you to retrieve a list of all invalid email addresses.**
3329
+ **This endpoint allows you to disassociate a link branding from a subuser.**
3332
3330
 
3333
- An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server.
3331
+ Link branding can be associated with subusers from the parent account. This functionality allows
3332
+ subusers to send mail using their parent's link brands. To associate a link branding, the parent account
3333
+ must first create a branded link and validate it. The parent may then associate that branded link with a subuser via the API or the Subuser Management page in the user interface.
3334
3334
 
3335
- Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server.
3335
+ Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
3336
3336
 
3337
- For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).
3337
+ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
3338
3338
 
3339
- ### GET /suppression/invalid_emails
3339
+ ### DELETE /whitelabel/links/subuser
3340
3340
 
3341
3341
 
3342
3342
  ```ruby
3343
- params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
3344
- response = sg.client.suppression.invalid_emails.get(query_params: params)
3343
+ params = JSON.parse('{"username": "test_string"}')
3344
+ response = sg.client.whitelabel.links.subuser.delete(query_params: params)
3345
3345
  puts response.status_code
3346
3346
  puts response.body
3347
3347
  puts response.headers
3348
3348
  ```
3349
- ## Delete invalid emails
3350
-
3351
- **This endpoint allows you to remove email addresses from your invalid email address list.**
3352
-
3353
- There are two options for deleting invalid email addresses:
3354
-
3355
- 1) You can delete all invalid email addresses by setting `delete_all` to true in the request body.
3356
- 2) You can delete some invalid email addresses by specifying certain addresses in an array in the request body.
3349
+ ## Update a Link Branding
3357
3350
 
3358
- An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server.
3351
+ **This endpoint allows you to update a specific link branding. You can use this endpoint to change a branded link's default status.**
3359
3352
 
3360
- Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server.
3353
+ Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
3361
3354
 
3362
- For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).
3355
+ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
3363
3356
 
3364
- ### DELETE /suppression/invalid_emails
3357
+ ### PATCH /whitelabel/links/{id}
3365
3358
 
3366
3359
 
3367
3360
  ```ruby
3368
3361
  data = JSON.parse('{
3369
- "delete_all": false,
3370
- "emails": [
3371
- "example1@example.com",
3372
- "example2@example.com"
3373
- ]
3362
+ "default": true
3374
3363
  }')
3375
- response = sg.client.suppression.invalid_emails.delete(request_body: data)
3364
+ id = "test_url_param"
3365
+ response = sg.client.whitelabel.links._(id).patch(request_body: data)
3376
3366
  puts response.status_code
3377
3367
  puts response.body
3378
3368
  puts response.headers
3379
3369
  ```
3380
- ## Retrieve a specific invalid email
3381
-
3382
- **This endpoint allows you to retrieve a specific invalid email addresses.**
3370
+ ## Retrieve a Link Branding
3383
3371
 
3384
- An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server.
3372
+ **This endpoint allows you to retrieve a specific link branding.**
3385
3373
 
3386
- Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server.
3374
+ Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
3387
3375
 
3388
- For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).
3376
+ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
3389
3377
 
3390
- ### GET /suppression/invalid_emails/{email}
3378
+ ### GET /whitelabel/links/{id}
3391
3379
 
3392
3380
 
3393
3381
  ```ruby
3394
- email = "test_url_param"
3395
- response = sg.client.suppression.invalid_emails._(email).get()
3382
+ id = "test_url_param"
3383
+ response = sg.client.whitelabel.links._(id).get()
3396
3384
  puts response.status_code
3397
3385
  puts response.body
3398
3386
  puts response.headers
3399
3387
  ```
3400
- ## Delete a specific invalid email
3401
-
3402
- **This endpoint allows you to remove a specific email address from the invalid email address list.**
3388
+ ## Delete a Link Branding
3403
3389
 
3404
- An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server.
3390
+ **This endpoint allows you to delete a link branding.**
3405
3391
 
3406
- Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server.
3392
+ Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
3407
3393
 
3408
- For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).
3394
+ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
3409
3395
 
3410
- ### DELETE /suppression/invalid_emails/{email}
3396
+ ### DELETE /whitelabel/links/{id}
3411
3397
 
3412
3398
 
3413
3399
  ```ruby
3414
- email = "test_url_param"
3415
- response = sg.client.suppression.invalid_emails._(email).delete()
3400
+ id = "test_url_param"
3401
+ response = sg.client.whitelabel.links._(id).delete()
3416
3402
  puts response.status_code
3417
3403
  puts response.body
3418
3404
  puts response.headers
3419
3405
  ```
3420
- ## Retrieve a specific spam report
3406
+ ## Validate a Link Branding
3421
3407
 
3422
- **This endpoint allows you to retrieve a specific spam report.**
3408
+ **This endpoint allows you to validate a link branding.**
3423
3409
 
3424
- [Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid.
3410
+ Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
3425
3411
 
3426
- For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).
3412
+ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
3427
3413
 
3428
- ### GET /suppression/spam_report/{email}
3414
+ ### POST /whitelabel/links/{id}/validate
3429
3415
 
3430
3416
 
3431
3417
  ```ruby
3432
- email = "test_url_param"
3433
- response = sg.client.suppression.spam_report._(email).get()
3418
+ id = "test_url_param"
3419
+ response = sg.client.whitelabel.links._(id).validate.post()
3434
3420
  puts response.status_code
3435
3421
  puts response.body
3436
3422
  puts response.headers
3437
3423
  ```
3438
- ## Delete a specific spam report
3424
+ ## Associate a Link Branding
3439
3425
 
3440
- **This endpoint allows you to delete a specific spam report.**
3426
+ **This endpoint allows you to associate a link branding with a subuser account.**
3441
3427
 
3442
- [Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid.
3428
+ Link branding can be associated with subusers from the parent account. This functionality allows
3429
+ subusers to send mail using their parent's link brands. To associate a link branding, the parent account
3430
+ must first create a branded link and validate it. The parent may then associate that branded link with a subuser via the API or the Subuser Management page in the user interface.
3443
3431
 
3444
- For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).
3432
+ Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
3445
3433
 
3446
- ### DELETE /suppression/spam_report/{email}
3434
+ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
3435
+
3436
+ ### POST /whitelabel/links/{link_id}/subuser
3447
3437
 
3448
3438
 
3449
3439
  ```ruby
3450
- email = "test_url_param"
3451
- response = sg.client.suppression.spam_report._(email).delete()
3440
+ data = JSON.parse('{
3441
+ "username": "jane@example.com"
3442
+ }')
3443
+ link_id = "test_url_param"
3444
+ response = sg.client.whitelabel.links._(link_id).subuser.post(request_body: data)
3452
3445
  puts response.status_code
3453
3446
  puts response.body
3454
3447
  puts response.headers
3455
3448
  ```
3456
- ## Retrieve all spam reports
3457
3449
 
3458
- **This endpoint allows you to retrieve all spam reports.**
3450
+ <a name="stats"></a>
3451
+ # STATS
3459
3452
 
3460
- [Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid.
3453
+ ## Retrieve global email statistics
3461
3454
 
3462
- For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).
3455
+ **This endpoint allows you to retrieve all of your global email statistics between a given date range.**
3463
3456
 
3464
- ### GET /suppression/spam_reports
3457
+ Parent accounts will see aggregated stats for their account and all subuser accounts. Subuser accounts will only see their own stats.
3458
+
3459
+ ### GET /stats
3465
3460
 
3466
3461
 
3467
3462
  ```ruby
3468
- params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
3469
- response = sg.client.suppression.spam_reports.get(query_params: params)
3463
+ params = JSON.parse('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}')
3464
+ response = sg.client.stats.get(query_params: params)
3470
3465
  puts response.status_code
3471
3466
  puts response.body
3472
3467
  puts response.headers
3473
3468
  ```
3474
- ## Delete spam reports
3475
-
3476
- **This endpoint allows you to delete your spam reports.**
3469
+ <a name="subusers"></a>
3470
+ # SUBUSERS
3477
3471
 
3478
- There are two options for deleting spam reports:
3472
+ ## Create Subuser
3479
3473
 
3480
- 1) You can delete all spam reports by setting "delete_all" to true in the request body.
3481
- 2) You can delete some spam reports by specifying the email addresses in an array in the request body.
3474
+ This endpoint allows you to retrieve a list of all of your subusers. You can choose to retrieve specific subusers as well as limit the results that come back from the API.
3482
3475
 
3483
- [Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid.
3476
+ For more information about Subusers:
3484
3477
 
3485
- For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).
3478
+ * [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)
3479
+ * [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)
3486
3480
 
3487
- ### DELETE /suppression/spam_reports
3481
+ ### POST /subusers
3488
3482
 
3489
3483
 
3490
3484
  ```ruby
3491
3485
  data = JSON.parse('{
3492
- "delete_all": false,
3493
- "emails": [
3494
- "example1@example.com",
3495
- "example2@example.com"
3496
- ]
3486
+ "email": "John@example.com",
3487
+ "ips": [
3488
+ "1.1.1.1",
3489
+ "2.2.2.2"
3490
+ ],
3491
+ "password": "johns_password",
3492
+ "username": "John@example.com"
3497
3493
  }')
3498
- response = sg.client.suppression.spam_reports.delete(request_body: data)
3494
+ response = sg.client.subusers.post(request_body: data)
3499
3495
  puts response.status_code
3500
3496
  puts response.body
3501
3497
  puts response.headers
3502
3498
  ```
3503
- ## Retrieve all global suppressions
3499
+ ## List all Subusers
3504
3500
 
3505
- **This endpoint allows you to retrieve a list of all email address that are globally suppressed.**
3501
+ This endpoint allows you to retrieve a list of all of your subusers. You can choose to retrieve specific subusers as well as limit the results that come back from the API.
3506
3502
 
3507
- 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).
3503
+ For more information about Subusers:
3508
3504
 
3509
- ### GET /suppression/unsubscribes
3505
+ * [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)
3506
+ * [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)
3507
+
3508
+ ### GET /subusers
3510
3509
 
3511
3510
 
3512
3511
  ```ruby
3513
- params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
3514
- response = sg.client.suppression.unsubscribes.get(query_params: params)
3512
+ params = JSON.parse('{"username": "test_string", "limit": 1, "offset": 1}')
3513
+ response = sg.client.subusers.get(query_params: params)
3515
3514
  puts response.status_code
3516
3515
  puts response.body
3517
3516
  puts response.headers
3518
3517
  ```
3519
- <a name="templates"></a>
3520
- # TEMPLATES
3521
-
3522
- ## Create a transactional template.
3518
+ ## Retrieve Subuser Reputations
3523
3519
 
3524
- **This endpoint allows you to create a transactional template.**
3520
+ Subuser sender reputations give a good idea how well a sender is doing with regards to how recipients and recipient servers react to the mail that is being received. When a bounce, spam report, or other negative action happens on a sent email, it will effect your sender rating.
3525
3521
 
3526
- Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts.
3522
+ This endpoint allows you to request the reputations for your subusers.
3527
3523
 
3528
- Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
3529
-
3530
- ### POST /templates
3524
+ ### GET /subusers/reputations
3531
3525
 
3532
3526
 
3533
3527
  ```ruby
3534
- data = JSON.parse('{
3535
- "name": "example_name"
3536
- }')
3537
- response = sg.client.templates.post(request_body: data)
3528
+ params = JSON.parse('{"usernames": "test_string"}')
3529
+ response = sg.client.subusers.reputations.get(query_params: params)
3538
3530
  puts response.status_code
3539
3531
  puts response.body
3540
3532
  puts response.headers
3541
3533
  ```
3542
- ## Retrieve all transactional templates.
3534
+ ## Retrieve email statistics for your subusers.
3543
3535
 
3544
- **This endpoint allows you to retrieve all transactional templates.**
3536
+ **This endpoint allows you to retrieve the email statistics for the given subusers.**
3545
3537
 
3546
- Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts.
3538
+ You may retrieve statistics for up to 10 different subusers by including an additional _subusers_ parameter for each additional subuser.
3547
3539
 
3548
- Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
3540
+ 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. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings.
3549
3541
 
3550
- ### GET /templates
3542
+ For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).
3543
+
3544
+ ### GET /subusers/stats
3551
3545
 
3552
3546
 
3553
3547
  ```ruby
3554
- response = sg.client.templates.get()
3548
+ params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01", "subusers": "test_string"}')
3549
+ response = sg.client.subusers.stats.get(query_params: params)
3555
3550
  puts response.status_code
3556
3551
  puts response.body
3557
3552
  puts response.headers
3558
3553
  ```
3559
- ## Edit a transactional template.
3554
+ ## Retrieve monthly stats for all subusers
3560
3555
 
3561
- **This endpoint allows you to edit a transactional template.**
3556
+ **This endpoint allows you to retrieve the monthly email statistics for all subusers over the given date range.**
3562
3557
 
3563
- Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts.
3558
+ 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.
3564
3559
 
3565
- Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
3560
+ When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics:
3561
+ `bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`.
3566
3562
 
3563
+ For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).
3567
3564
 
3568
- ### PATCH /templates/{template_id}
3565
+ ### GET /subusers/stats/monthly
3569
3566
 
3570
3567
 
3571
3568
  ```ruby
3572
- data = JSON.parse('{
3573
- "name": "new_example_name"
3574
- }')
3575
- template_id = "test_url_param"
3576
- response = sg.client.templates._(template_id).patch(request_body: data)
3569
+ params = JSON.parse('{"subuser": "test_string", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "date": "test_string", "sort_by_direction": "asc"}')
3570
+ response = sg.client.subusers.stats.monthly.get(query_params: params)
3577
3571
  puts response.status_code
3578
3572
  puts response.body
3579
3573
  puts response.headers
3580
3574
  ```
3581
- ## Retrieve a single transactional template.
3575
+ ## Retrieve the totals for each email statistic metric for all subusers.
3582
3576
 
3583
- **This endpoint allows you to retrieve a single transactional template.**
3577
+ **This endpoint allows you to retrieve the total sums of each email statistic metric for all subusers over the given date range.**
3584
3578
 
3585
- Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts.
3586
3579
 
3587
- Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
3580
+ 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. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings.
3588
3581
 
3582
+ For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).
3589
3583
 
3590
- ### GET /templates/{template_id}
3584
+ ### GET /subusers/stats/sums
3591
3585
 
3592
3586
 
3593
3587
  ```ruby
3594
- template_id = "test_url_param"
3595
- response = sg.client.templates._(template_id).get()
3588
+ params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "start_date": "2016-01-01", "sort_by_direction": "asc"}')
3589
+ response = sg.client.subusers.stats.sums.get(query_params: params)
3596
3590
  puts response.status_code
3597
3591
  puts response.body
3598
3592
  puts response.headers
3599
3593
  ```
3600
- ## Delete a template.
3601
-
3602
- **This endpoint allows you to delete a transactional template.**
3594
+ ## Enable/disable a subuser
3603
3595
 
3604
- Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts.
3596
+ This endpoint allows you to enable or disable a subuser.
3605
3597
 
3606
- Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
3598
+ For more information about Subusers:
3607
3599
 
3600
+ * [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)
3601
+ * [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)
3608
3602
 
3609
- ### DELETE /templates/{template_id}
3603
+ ### PATCH /subusers/{subuser_name}
3610
3604
 
3611
3605
 
3612
3606
  ```ruby
3613
- template_id = "test_url_param"
3614
- response = sg.client.templates._(template_id).delete()
3607
+ data = JSON.parse('{
3608
+ "disabled": false
3609
+ }')
3610
+ subuser_name = "test_url_param"
3611
+ response = sg.client.subusers._(subuser_name).patch(request_body: data)
3615
3612
  puts response.status_code
3616
3613
  puts response.body
3617
3614
  puts response.headers
3618
3615
  ```
3619
- ## Create a new transactional template version.
3620
-
3621
- **This endpoint allows you to create a new version of a template.**
3616
+ ## Delete a subuser
3622
3617
 
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.
3618
+ This endpoint allows you to delete a subuser. This is a permanent action, once deleted a subuser cannot be retrieved.
3624
3619
 
3625
- For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
3620
+ For more information about Subusers:
3626
3621
 
3622
+ * [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)
3623
+ * [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)
3627
3624
 
3628
- ### POST /templates/{template_id}/versions
3625
+ ### DELETE /subusers/{subuser_name}
3629
3626
 
3630
3627
 
3631
3628
  ```ruby
3632
- data = JSON.parse('{
3633
- "active": 1,
3634
- "html_content": "<%body%>",
3635
- "name": "example_version_name",
3636
- "plain_content": "<%body%>",
3637
- "subject": "<%subject%>",
3638
- "template_id": "ddb96bbc-9b92-425e-8979-99464621b543"
3639
- }')
3640
- template_id = "test_url_param"
3641
- response = sg.client.templates._(template_id).versions.post(request_body: data)
3629
+ subuser_name = "test_url_param"
3630
+ response = sg.client.subusers._(subuser_name).delete()
3642
3631
  puts response.status_code
3643
3632
  puts response.body
3644
3633
  puts response.headers
3645
3634
  ```
3646
- ## Edit a transactional template version.
3647
-
3648
- **This endpoint allows you to edit a version of one of your transactional templates.**
3635
+ ## Update IPs assigned to a subuser
3649
3636
 
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.
3637
+ Each subuser should be assigned to an IP address, from which all of this subuser's mail will be sent. Often, this is the same IP as the parent account, but each subuser can have their own, or multiple, IP addresses as well.
3651
3638
 
3652
- For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
3639
+ More information:
3653
3640
 
3654
- ## URI Parameters
3655
- | URI Parameter | Type | Description |
3656
- |---|---|---|
3657
- | template_id | string | The ID of the original template |
3658
- | version_id | string | The ID of the template version |
3641
+ * [How to request more IPs](https://sendgrid.com/docs/Classroom/Basics/Account/adding_an_additional_dedicated_ip_to_your_account.html)
3642
+ * [How to setup reverse DNS](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/)
3659
3643
 
3660
- ### PATCH /templates/{template_id}/versions/{version_id}
3644
+ ### PUT /subusers/{subuser_name}/ips
3661
3645
 
3662
3646
 
3663
3647
  ```ruby
3664
- data = JSON.parse('{
3665
- "active": 1,
3666
- "html_content": "<%body%>",
3667
- "name": "updated_example_name",
3668
- "plain_content": "<%body%>",
3669
- "subject": "<%subject%>"
3670
- }')
3671
- template_id = "test_url_param"
3672
- version_id = "test_url_param"
3673
- response = sg.client.templates._(template_id).versions._(version_id).patch(request_body: data)
3648
+ data = JSON.parse('[
3649
+ "127.0.0.1"
3650
+ ]')
3651
+ subuser_name = "test_url_param"
3652
+ response = sg.client.subusers._(subuser_name).ips.put(request_body: data)
3674
3653
  puts response.status_code
3675
3654
  puts response.body
3676
3655
  puts response.headers
3677
3656
  ```
3678
- ## Retrieve a specific transactional template version.
3657
+ ## Update Monitor Settings for a subuser
3679
3658
 
3680
- **This endpoint allows you to retrieve a specific version of a template.**
3659
+ Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.
3681
3660
 
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.
3661
+ ### PUT /subusers/{subuser_name}/monitor
3683
3662
 
3684
- For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
3685
3663
 
3686
- ## URI Parameters
3687
- | URI Parameter | Type | Description |
3688
- |---|---|---|
3689
- | template_id | string | The ID of the original template |
3690
- | version_id | string | The ID of the template version |
3664
+ ```ruby
3665
+ data = JSON.parse('{
3666
+ "email": "example@example.com",
3667
+ "frequency": 500
3668
+ }')
3669
+ subuser_name = "test_url_param"
3670
+ response = sg.client.subusers._(subuser_name).monitor.put(request_body: data)
3671
+ puts response.status_code
3672
+ puts response.body
3673
+ puts response.headers
3674
+ ```
3675
+ ## Create monitor settings
3691
3676
 
3692
- ### GET /templates/{template_id}/versions/{version_id}
3677
+ Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.
3678
+
3679
+ ### POST /subusers/{subuser_name}/monitor
3693
3680
 
3694
3681
 
3695
3682
  ```ruby
3696
- template_id = "test_url_param"
3697
- version_id = "test_url_param"
3698
- response = sg.client.templates._(template_id).versions._(version_id).get()
3683
+ data = JSON.parse('{
3684
+ "email": "example@example.com",
3685
+ "frequency": 50000
3686
+ }')
3687
+ subuser_name = "test_url_param"
3688
+ response = sg.client.subusers._(subuser_name).monitor.post(request_body: data)
3699
3689
  puts response.status_code
3700
3690
  puts response.body
3701
3691
  puts response.headers
3702
3692
  ```
3703
- ## Delete a transactional template version.
3693
+ ## Retrieve monitor settings for a subuser
3704
3694
 
3705
- **This endpoint allows you to delete one of your transactional template versions.**
3695
+ Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.
3706
3696
 
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.
3697
+ ### GET /subusers/{subuser_name}/monitor
3708
3698
 
3709
- For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
3710
3699
 
3711
- ## URI Parameters
3712
- | URI Parameter | Type | Description |
3713
- |---|---|---|
3714
- | template_id | string | The ID of the original template |
3715
- | version_id | string | The ID of the template version |
3700
+ ```ruby
3701
+ subuser_name = "test_url_param"
3702
+ response = sg.client.subusers._(subuser_name).monitor.get()
3703
+ puts response.status_code
3704
+ puts response.body
3705
+ puts response.headers
3706
+ ```
3707
+ ## Delete monitor settings
3716
3708
 
3717
- ### DELETE /templates/{template_id}/versions/{version_id}
3709
+ Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.
3710
+
3711
+ ### DELETE /subusers/{subuser_name}/monitor
3718
3712
 
3719
3713
 
3720
3714
  ```ruby
3721
- template_id = "test_url_param"
3722
- version_id = "test_url_param"
3723
- response = sg.client.templates._(template_id).versions._(version_id).delete()
3715
+ subuser_name = "test_url_param"
3716
+ response = sg.client.subusers._(subuser_name).monitor.delete()
3724
3717
  puts response.status_code
3725
3718
  puts response.body
3726
3719
  puts response.headers
3727
3720
  ```
3728
- ## Activate a transactional template version.
3729
-
3730
- **This endpoint allows you to activate a version of one of your templates.**
3721
+ ## Retrieve the monthly email statistics for a single subuser
3731
3722
 
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.
3723
+ **This endpoint allows you to retrieve the monthly email statistics for a specific subuser.**
3733
3724
 
3725
+ 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.
3734
3726
 
3735
- For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
3727
+ When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics:
3728
+ `bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`.
3736
3729
 
3737
- ## URI Parameters
3738
- | URI Parameter | Type | Description |
3739
- |---|---|---|
3740
- | template_id | string | The ID of the original template |
3741
- | version_id | string | The ID of the template version |
3730
+ For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).
3742
3731
 
3743
- ### POST /templates/{template_id}/versions/{version_id}/activate
3732
+ ### GET /subusers/{subuser_name}/stats/monthly
3744
3733
 
3745
3734
 
3746
3735
  ```ruby
3747
- template_id = "test_url_param"
3748
- version_id = "test_url_param"
3749
- response = sg.client.templates._(template_id).versions._(version_id).activate.post()
3736
+ params = JSON.parse('{"date": "test_string", "sort_by_direction": "asc", "limit": 1, "sort_by_metric": "test_string", "offset": 1}')
3737
+ subuser_name = "test_url_param"
3738
+ response = sg.client.subusers._(subuser_name).stats.monthly.get(query_params: params)
3750
3739
  puts response.status_code
3751
3740
  puts response.body
3752
3741
  puts response.headers
3753
3742
  ```
3754
- <a name="tracking-settings"></a>
3755
- # TRACKING SETTINGS
3743
+ <a name="suppression"></a>
3744
+ # SUPPRESSION
3756
3745
 
3757
- ## Retrieve Tracking Settings
3746
+ ## Retrieve all blocks
3758
3747
 
3759
- **This endpoint allows you to retrieve a list of all tracking settings that you can enable on your account.**
3748
+ **This endpoint allows you to retrieve a list of all email addresses that are currently on your blocks list.**
3760
3749
 
3761
- You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
3750
+ [Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server.
3762
3751
 
3763
- For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
3752
+ For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).
3764
3753
 
3765
- ### GET /tracking_settings
3754
+ ### GET /suppression/blocks
3766
3755
 
3767
3756
 
3768
3757
  ```ruby
3769
- params = JSON.parse('{"limit": 1, "offset": 1}')
3770
- response = sg.client.tracking_settings.get(query_params: params)
3758
+ params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
3759
+ response = sg.client.suppression.blocks.get(query_params: params)
3771
3760
  puts response.status_code
3772
3761
  puts response.body
3773
3762
  puts response.headers
3774
3763
  ```
3775
- ## Update Click Tracking Settings
3764
+ ## Delete blocks
3776
3765
 
3777
- **This endpoint allows you to change your current click tracking setting. You can enable, or disable, click tracking using this endpoint.**
3766
+ **This endpoint allows you to delete all email addresses on your blocks list.**
3778
3767
 
3779
- You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
3768
+ There are two options for deleting blocked emails:
3780
3769
 
3781
- For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
3770
+ 1. You can delete all blocked emails by setting `delete_all` to true in the request body.
3771
+ 2. You can delete some blocked emails by specifying the email addresses in an array in the request body.
3782
3772
 
3783
- ### PATCH /tracking_settings/click
3773
+ [Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server.
3774
+
3775
+ For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).
3776
+
3777
+ ### DELETE /suppression/blocks
3784
3778
 
3785
3779
 
3786
3780
  ```ruby
3787
3781
  data = JSON.parse('{
3788
- "enabled": true
3782
+ "delete_all": false,
3783
+ "emails": [
3784
+ "example1@example.com",
3785
+ "example2@example.com"
3786
+ ]
3789
3787
  }')
3790
- response = sg.client.tracking_settings.click.patch(request_body: data)
3788
+ response = sg.client.suppression.blocks.delete(request_body: data)
3791
3789
  puts response.status_code
3792
3790
  puts response.body
3793
3791
  puts response.headers
3794
3792
  ```
3795
- ## Retrieve Click Track Settings
3793
+ ## Retrieve a specific block
3796
3794
 
3797
- **This endpoint allows you to retrieve your current click tracking setting.**
3795
+ **This endpoint allows you to retrieve a specific email address from your blocks list.**
3798
3796
 
3799
- You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
3797
+ [Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server.
3800
3798
 
3801
- For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
3799
+ For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).
3802
3800
 
3803
- ### GET /tracking_settings/click
3801
+ ### GET /suppression/blocks/{email}
3804
3802
 
3805
3803
 
3806
3804
  ```ruby
3807
- response = sg.client.tracking_settings.click.get()
3805
+ email = "test_url_param"
3806
+ response = sg.client.suppression.blocks._(email).get()
3808
3807
  puts response.status_code
3809
3808
  puts response.body
3810
3809
  puts response.headers
3811
3810
  ```
3812
- ## Update Google Analytics Settings
3813
-
3814
- **This endpoint allows you to update your current setting for Google Analytics.**
3815
-
3816
- For more information about using Google Analytics, please refer to [Googles URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on ["Best Practices for Campaign Building"](https://support.google.com/analytics/answer/1037445).
3811
+ ## Delete a specific block
3817
3812
 
3818
- We default the settings to Googles recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/google_analytics_demystified_ga_statistics_vs_sg_statistics.html).
3813
+ **This endpoint allows you to delete a specific email address from your blocks list.**
3819
3814
 
3820
- You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
3815
+ [Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server.
3821
3816
 
3822
- For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
3817
+ For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).
3823
3818
 
3824
- ### PATCH /tracking_settings/google_analytics
3819
+ ### DELETE /suppression/blocks/{email}
3825
3820
 
3826
3821
 
3827
3822
  ```ruby
3828
- data = JSON.parse('{
3829
- "enabled": true,
3830
- "utm_campaign": "website",
3831
- "utm_content": "",
3832
- "utm_medium": "email",
3833
- "utm_source": "sendgrid.com",
3834
- "utm_term": ""
3835
- }')
3836
- response = sg.client.tracking_settings.google_analytics.patch(request_body: data)
3823
+ email = "test_url_param"
3824
+ response = sg.client.suppression.blocks._(email).delete()
3837
3825
  puts response.status_code
3838
3826
  puts response.body
3839
3827
  puts response.headers
3840
3828
  ```
3841
- ## Retrieve Google Analytics Settings
3842
-
3843
- **This endpoint allows you to retrieve your current setting for Google Analytics.**
3829
+ ## Retrieve all bounces
3844
3830
 
3845
- For more information about using Google Analytics, please refer to [Googles URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on ["Best Practices for Campaign Building"](https://support.google.com/analytics/answer/1037445).
3831
+ **This endpoint allows you to retrieve all of your bounces.**
3846
3832
 
3847
- We default the settings to Googles recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/google_analytics_demystified_ga_statistics_vs_sg_statistics.html).
3833
+ Bounces are messages that are returned to the server that sent it.
3848
3834
 
3849
- You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
3835
+ For more information see:
3850
3836
 
3851
- For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
3837
+ * [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information
3838
+ * [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
3852
3839
 
3853
- ### GET /tracking_settings/google_analytics
3840
+ ### GET /suppression/bounces
3854
3841
 
3855
3842
 
3856
3843
  ```ruby
3857
- response = sg.client.tracking_settings.google_analytics.get()
3844
+ params = JSON.parse('{"start_time": 1, "end_time": 1}')
3845
+ response = sg.client.suppression.bounces.get(query_params: params)
3858
3846
  puts response.status_code
3859
3847
  puts response.body
3860
3848
  puts response.headers
3861
3849
  ```
3862
- ## Update Open Tracking Settings
3850
+ ## Delete bounces
3863
3851
 
3864
- **This endpoint allows you to update your current settings for open tracking.**
3852
+ **This endpoint allows you to delete all of your bounces. You can also use this endpoint to remove a specific email address from your bounce list.**
3865
3853
 
3866
- Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to SendGrids server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook.
3854
+ Bounces are messages that are returned to the server that sent it.
3867
3855
 
3868
- You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
3856
+ For more information see:
3869
3857
 
3870
- For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
3858
+ * [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information
3859
+ * [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
3860
+ * [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html)
3871
3861
 
3872
- ### PATCH /tracking_settings/open
3862
+ Note: the `delete_all` and `emails` parameters should be used independently of each other as they have different purposes.
3863
+
3864
+ ### DELETE /suppression/bounces
3873
3865
 
3874
3866
 
3875
3867
  ```ruby
3876
3868
  data = JSON.parse('{
3877
- "enabled": true
3869
+ "delete_all": true,
3870
+ "emails": [
3871
+ "example@example.com",
3872
+ "example2@example.com"
3873
+ ]
3878
3874
  }')
3879
- response = sg.client.tracking_settings.open.patch(request_body: data)
3875
+ response = sg.client.suppression.bounces.delete(request_body: data)
3880
3876
  puts response.status_code
3881
3877
  puts response.body
3882
3878
  puts response.headers
3883
3879
  ```
3884
- ## Get Open Tracking Settings
3880
+ ## Retrieve a Bounce
3885
3881
 
3886
- **This endpoint allows you to retrieve your current settings for open tracking.**
3882
+ **This endpoint allows you to retrieve a specific bounce for a given email address.**
3887
3883
 
3888
- Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to SendGrids server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook.
3884
+ Bounces are messages that are returned to the server that sent it.
3889
3885
 
3890
- You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
3886
+ For more information see:
3891
3887
 
3892
- For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
3888
+ * [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information
3889
+ * [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
3890
+ * [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html)
3893
3891
 
3894
- ### GET /tracking_settings/open
3892
+ ### GET /suppression/bounces/{email}
3895
3893
 
3896
3894
 
3897
3895
  ```ruby
3898
- response = sg.client.tracking_settings.open.get()
3896
+ email = "test_url_param"
3897
+ response = sg.client.suppression.bounces._(email).get()
3899
3898
  puts response.status_code
3900
3899
  puts response.body
3901
3900
  puts response.headers
3902
3901
  ```
3903
- ## Update Subscription Tracking Settings
3902
+ ## Delete a bounce
3904
3903
 
3905
- **This endpoint allows you to update your current settings for subscription tracking.**
3904
+ **This endpoint allows you to remove an email address from your bounce list.**
3906
3905
 
3907
- Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails.
3906
+ Bounces are messages that are returned to the server that sent it. This endpoint allows you to delete a single email addresses from your bounce list.
3908
3907
 
3909
- You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
3908
+ For more information see:
3910
3909
 
3911
- For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
3910
+ * [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information
3911
+ * [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
3912
+ * [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html)
3912
3913
 
3913
- ### PATCH /tracking_settings/subscription
3914
+ ### DELETE /suppression/bounces/{email}
3914
3915
 
3915
3916
 
3916
3917
  ```ruby
3917
- data = JSON.parse('{
3918
- "enabled": true,
3919
- "html_content": "html content",
3920
- "landing": "landing page html",
3921
- "plain_content": "text content",
3922
- "replace": "replacement tag",
3923
- "url": "url"
3924
- }')
3925
- response = sg.client.tracking_settings.subscription.patch(request_body: data)
3918
+ params = JSON.parse('{"email_address": "example@example.com"}')
3919
+ email = "test_url_param"
3920
+ response = sg.client.suppression.bounces._(email).delete(query_params: params)
3926
3921
  puts response.status_code
3927
3922
  puts response.body
3928
3923
  puts response.headers
3929
3924
  ```
3930
- ## Retrieve Subscription Tracking Settings
3925
+ ## Retrieve all invalid emails
3931
3926
 
3932
- **This endpoint allows you to retrieve your current settings for subscription tracking.**
3927
+ **This endpoint allows you to retrieve a list of all invalid email addresses.**
3933
3928
 
3934
- Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails.
3929
+ An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server.
3935
3930
 
3936
- You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
3931
+ Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server.
3937
3932
 
3938
- For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
3933
+ For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).
3939
3934
 
3940
- ### GET /tracking_settings/subscription
3935
+ ### GET /suppression/invalid_emails
3941
3936
 
3942
3937
 
3943
3938
  ```ruby
3944
- response = sg.client.tracking_settings.subscription.get()
3939
+ params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
3940
+ response = sg.client.suppression.invalid_emails.get(query_params: params)
3945
3941
  puts response.status_code
3946
3942
  puts response.body
3947
3943
  puts response.headers
3948
3944
  ```
3949
- <a name="user"></a>
3950
- # USER
3945
+ ## Delete invalid emails
3951
3946
 
3952
- ## Get a user's account information.
3947
+ **This endpoint allows you to remove email addresses from your invalid email address list.**
3953
3948
 
3954
- **This endpoint allows you to retrieve your user account details.**
3949
+ There are two options for deleting invalid email addresses:
3955
3950
 
3956
- Your user's account information includes the user's account type and reputation.
3951
+ 1) You can delete all invalid email addresses by setting `delete_all` to true in the request body.
3952
+ 2) You can delete some invalid email addresses by specifying certain addresses in an array in the request body.
3957
3953
 
3958
- Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to.
3954
+ An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server.
3959
3955
 
3960
- For more information about your user profile:
3956
+ Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server.
3961
3957
 
3962
- * [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
3958
+ For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).
3963
3959
 
3964
- ### GET /user/account
3960
+ ### DELETE /suppression/invalid_emails
3965
3961
 
3966
3962
 
3967
3963
  ```ruby
3968
- response = sg.client.user.account.get()
3964
+ data = JSON.parse('{
3965
+ "delete_all": false,
3966
+ "emails": [
3967
+ "example1@example.com",
3968
+ "example2@example.com"
3969
+ ]
3970
+ }')
3971
+ response = sg.client.suppression.invalid_emails.delete(request_body: data)
3969
3972
  puts response.status_code
3970
3973
  puts response.body
3971
3974
  puts response.headers
3972
3975
  ```
3973
- ## Retrieve your credit balance
3976
+ ## Retrieve a specific invalid email
3974
3977
 
3975
- **This endpoint allows you to retrieve the current credit balance for your account.**
3978
+ **This endpoint allows you to retrieve a specific invalid email addresses.**
3976
3979
 
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).
3980
+ An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server.
3978
3981
 
3979
- ### GET /user/credits
3982
+ Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server.
3983
+
3984
+ For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).
3985
+
3986
+ ### GET /suppression/invalid_emails/{email}
3980
3987
 
3981
3988
 
3982
3989
  ```ruby
3983
- response = sg.client.user.credits.get()
3990
+ email = "test_url_param"
3991
+ response = sg.client.suppression.invalid_emails._(email).get()
3984
3992
  puts response.status_code
3985
3993
  puts response.body
3986
3994
  puts response.headers
3987
3995
  ```
3988
- ## Update your account email address
3996
+ ## Delete a specific invalid email
3989
3997
 
3990
- **This endpoint allows you to update the email address currently on file for your account.**
3998
+ **This endpoint allows you to remove a specific email address from the invalid email address list.**
3991
3999
 
3992
- Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to.
4000
+ An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server.
3993
4001
 
3994
- For more information about your user profile:
4002
+ Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server.
3995
4003
 
3996
- * [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
4004
+ For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).
3997
4005
 
3998
- ### PUT /user/email
4006
+ ### DELETE /suppression/invalid_emails/{email}
4007
+
4008
+
4009
+ ```ruby
4010
+ email = "test_url_param"
4011
+ response = sg.client.suppression.invalid_emails._(email).delete()
4012
+ puts response.status_code
4013
+ puts response.body
4014
+ puts response.headers
4015
+ ```
4016
+ ## Retrieve a specific spam report
4017
+
4018
+ **This endpoint allows you to retrieve a specific spam report.**
4019
+
4020
+ [Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid.
4021
+
4022
+ For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).
4023
+
4024
+ ### GET /suppression/spam_report/{email}
3999
4025
 
4000
4026
 
4001
4027
  ```ruby
4002
- data = JSON.parse('{
4003
- "email": "example@example.com"
4004
- }')
4005
- response = sg.client.user.email.put(request_body: data)
4028
+ email = "test_url_param"
4029
+ response = sg.client.suppression.spam_reports._(email).get()
4006
4030
  puts response.status_code
4007
4031
  puts response.body
4008
4032
  puts response.headers
4009
4033
  ```
4010
- ## Retrieve your account email address
4011
-
4012
- **This endpoint allows you to retrieve the email address currently on file for your account.**
4034
+ ## Delete a specific spam report
4013
4035
 
4014
- Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to.
4036
+ **This endpoint allows you to delete a specific spam report.**
4015
4037
 
4016
- For more information about your user profile:
4038
+ [Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid.
4017
4039
 
4018
- * [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
4040
+ For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).
4019
4041
 
4020
- ### GET /user/email
4042
+ ### DELETE /suppression/spam_report/{email}
4021
4043
 
4022
4044
 
4023
4045
  ```ruby
4024
- response = sg.client.user.email.get()
4046
+ email = "test_url_param"
4047
+ response = sg.client.suppression.spam_reports._(email).delete()
4025
4048
  puts response.status_code
4026
4049
  puts response.body
4027
4050
  puts response.headers
4028
4051
  ```
4029
- ## Update your password
4030
-
4031
- **This endpoint allows you to update your password.**
4052
+ ## Retrieve all spam reports
4032
4053
 
4033
- Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to.
4054
+ **This endpoint allows you to retrieve all spam reports.**
4034
4055
 
4035
- For more information about your user profile:
4056
+ [Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid.
4036
4057
 
4037
- * [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
4058
+ For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).
4038
4059
 
4039
- ### PUT /user/password
4060
+ ### GET /suppression/spam_reports
4040
4061
 
4041
4062
 
4042
4063
  ```ruby
4043
- data = JSON.parse('{
4044
- "new_password": "new_password",
4045
- "old_password": "old_password"
4046
- }')
4047
- response = sg.client.user.password.put(request_body: data)
4064
+ params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
4065
+ response = sg.client.suppression.spam_reports.get(query_params: params)
4048
4066
  puts response.status_code
4049
4067
  puts response.body
4050
4068
  puts response.headers
4051
4069
  ```
4052
- ## Update a user's profile
4070
+ ## Delete spam reports
4053
4071
 
4054
- **This endpoint allows you to update your current profile details.**
4072
+ **This endpoint allows you to delete your spam reports.**
4055
4073
 
4056
- Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to.
4074
+ There are two options for deleting spam reports:
4057
4075
 
4058
- For more information about your user profile:
4076
+ 1) You can delete all spam reports by setting "delete_all" to true in the request body.
4077
+ 2) You can delete some spam reports by specifying the email addresses in an array in the request body.
4059
4078
 
4060
- * [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
4079
+ [Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid.
4061
4080
 
4062
- It should be noted that any one or more of the parameters can be updated via the PATCH /user/profile endpoint. The only requirement is that you include at least one when you PATCH.
4081
+ For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).
4063
4082
 
4064
- ### PATCH /user/profile
4083
+ ### DELETE /suppression/spam_reports
4065
4084
 
4066
4085
 
4067
4086
  ```ruby
4068
4087
  data = JSON.parse('{
4069
- "city": "Orange",
4070
- "first_name": "Example",
4071
- "last_name": "User"
4088
+ "delete_all": false,
4089
+ "emails": [
4090
+ "example1@example.com",
4091
+ "example2@example.com"
4092
+ ]
4072
4093
  }')
4073
- response = sg.client.user.profile.patch(request_body: data)
4094
+ response = sg.client.suppression.spam_reports.delete(request_body: data)
4074
4095
  puts response.status_code
4075
4096
  puts response.body
4076
4097
  puts response.headers
4077
4098
  ```
4078
- ## Get a user's profile
4079
-
4080
- Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to.
4099
+ ## Retrieve all global suppressions
4081
4100
 
4082
- For more information about your user profile:
4101
+ **This endpoint allows you to retrieve a list of all email address that are globally suppressed.**
4083
4102
 
4084
- * [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
4103
+ 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).
4085
4104
 
4086
- ### GET /user/profile
4105
+ ### GET /suppression/unsubscribes
4087
4106
 
4088
4107
 
4089
4108
  ```ruby
4090
- response = sg.client.user.profile.get()
4109
+ params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
4110
+ response = sg.client.suppression.unsubscribes.get(query_params: params)
4091
4111
  puts response.status_code
4092
4112
  puts response.body
4093
4113
  puts response.headers
4094
4114
  ```
4095
- ## Cancel or pause a scheduled send
4115
+ <a name="templates"></a>
4116
+ # TEMPLATES
4096
4117
 
4097
- **This endpoint allows you to cancel or pause an email that has been scheduled to be sent.**
4118
+ ## Create a transactional template.
4098
4119
 
4099
- If the maximum number of cancellations/pauses are added, HTTP 400 will
4100
- be returned.
4120
+ **This endpoint allows you to create a transactional template.**
4101
4121
 
4102
- The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.
4122
+ Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts.
4103
4123
 
4104
- ### POST /user/scheduled_sends
4124
+ Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
4125
+
4126
+ ### POST /templates
4105
4127
 
4106
4128
 
4107
4129
  ```ruby
4108
4130
  data = JSON.parse('{
4109
- "batch_id": "YOUR_BATCH_ID",
4110
- "status": "pause"
4131
+ "name": "example_name"
4111
4132
  }')
4112
- response = sg.client.user.scheduled_sends.post(request_body: data)
4133
+ response = sg.client.templates.post(request_body: data)
4113
4134
  puts response.status_code
4114
4135
  puts response.body
4115
4136
  puts response.headers
4116
4137
  ```
4117
- ## Retrieve all scheduled sends
4138
+ ## Retrieve all transactional templates.
4118
4139
 
4119
- **This endpoint allows you to retrieve all cancel/paused scheduled send information.**
4140
+ **This endpoint allows you to retrieve all transactional templates.**
4120
4141
 
4121
- The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.
4142
+ Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts.
4122
4143
 
4123
- ### GET /user/scheduled_sends
4144
+ Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
4145
+
4146
+ ### GET /templates
4124
4147
 
4125
4148
 
4126
4149
  ```ruby
4127
- response = sg.client.user.scheduled_sends.get()
4150
+ response = sg.client.templates.get()
4128
4151
  puts response.status_code
4129
4152
  puts response.body
4130
4153
  puts response.headers
4131
4154
  ```
4132
- ## Update user scheduled send information
4155
+ ## Edit a transactional template.
4133
4156
 
4134
- **This endpoint allows you to update the status of a scheduled send for the given `batch_id`.**
4157
+ **This endpoint allows you to edit a transactional template.**
4135
4158
 
4136
- The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.
4159
+ Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts.
4160
+
4161
+ Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
4137
4162
 
4138
- ### PATCH /user/scheduled_sends/{batch_id}
4163
+
4164
+ ### PATCH /templates/{template_id}
4139
4165
 
4140
4166
 
4141
4167
  ```ruby
4142
4168
  data = JSON.parse('{
4143
- "status": "pause"
4169
+ "name": "new_example_name"
4144
4170
  }')
4145
- batch_id = "test_url_param"
4146
- response = sg.client.user.scheduled_sends._(batch_id).patch(request_body: data)
4171
+ template_id = "test_url_param"
4172
+ response = sg.client.templates._(template_id).patch(request_body: data)
4147
4173
  puts response.status_code
4148
4174
  puts response.body
4149
4175
  puts response.headers
4150
4176
  ```
4151
- ## Retrieve scheduled send
4152
-
4153
- **This endpoint allows you to retrieve the cancel/paused scheduled send information for a specific `batch_id`.**
4154
-
4155
- The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.
4156
-
4157
- ### GET /user/scheduled_sends/{batch_id}
4177
+ ## Retrieve a single transactional template.
4158
4178
 
4179
+ **This endpoint allows you to retrieve a single transactional template.**
4159
4180
 
4160
- ```ruby
4161
- batch_id = "test_url_param"
4162
- response = sg.client.user.scheduled_sends._(batch_id).get()
4163
- puts response.status_code
4164
- puts response.body
4165
- puts response.headers
4166
- ```
4167
- ## Delete a cancellation or pause of a scheduled send
4181
+ Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts.
4168
4182
 
4169
- **This endpoint allows you to delete the cancellation/pause of a scheduled send.**
4183
+ Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
4170
4184
 
4171
- The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.
4172
4185
 
4173
- ### DELETE /user/scheduled_sends/{batch_id}
4186
+ ### GET /templates/{template_id}
4174
4187
 
4175
4188
 
4176
4189
  ```ruby
4177
- batch_id = "test_url_param"
4178
- response = sg.client.user.scheduled_sends._(batch_id).delete()
4190
+ template_id = "test_url_param"
4191
+ response = sg.client.templates._(template_id).get()
4179
4192
  puts response.status_code
4180
4193
  puts response.body
4181
4194
  puts response.headers
4182
4195
  ```
4183
- ## Update Enforced TLS settings
4196
+ ## Delete a template.
4184
4197
 
4185
- **This endpoint allows you to update your current Enforced TLS settings.**
4198
+ **This endpoint allows you to delete a transactional template.**
4186
4199
 
4187
- The Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate. See the [SMTP Ports User Guide](https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html) for more information on opportunistic TLS.
4200
+ Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts.
4188
4201
 
4189
- **Note:** If either setting is enabled and the recipient does not support TLS or have a valid certificate, we drop the message and send a block event with TLS required but not supported as the description.
4202
+ Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
4190
4203
 
4191
- ### PATCH /user/settings/enforced_tls
4204
+
4205
+ ### DELETE /templates/{template_id}
4192
4206
 
4193
4207
 
4194
4208
  ```ruby
4195
- data = JSON.parse('{
4196
- "require_tls": true,
4197
- "require_valid_cert": false
4198
- }')
4199
- response = sg.client.user.settings.enforced_tls.patch(request_body: data)
4209
+ template_id = "test_url_param"
4210
+ response = sg.client.templates._(template_id).delete()
4200
4211
  puts response.status_code
4201
4212
  puts response.body
4202
4213
  puts response.headers
4203
4214
  ```
4204
- ## Retrieve current Enforced TLS settings.
4215
+ ## Create a new transactional template version.
4205
4216
 
4206
- **This endpoint allows you to retrieve your current Enforced TLS settings.**
4217
+ **This endpoint allows you to create a new version of a template.**
4207
4218
 
4208
- The Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate. See the [SMTP Ports User Guide](https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html) for more information on opportunistic TLS.
4219
+ 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.
4209
4220
 
4210
- **Note:** If either setting is enabled and the recipient does not support TLS or have a valid certificate, we drop the message and send a block event with TLS required but not supported as the description.
4221
+ For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
4211
4222
 
4212
- ### GET /user/settings/enforced_tls
4223
+
4224
+ ### POST /templates/{template_id}/versions
4213
4225
 
4214
4226
 
4215
4227
  ```ruby
4216
- response = sg.client.user.settings.enforced_tls.get()
4228
+ data = JSON.parse('{
4229
+ "active": 1,
4230
+ "html_content": "<%body%>",
4231
+ "name": "example_version_name",
4232
+ "plain_content": "<%body%>",
4233
+ "subject": "<%subject%>",
4234
+ "template_id": "ddb96bbc-9b92-425e-8979-99464621b543"
4235
+ }')
4236
+ template_id = "test_url_param"
4237
+ response = sg.client.templates._(template_id).versions.post(request_body: data)
4217
4238
  puts response.status_code
4218
4239
  puts response.body
4219
4240
  puts response.headers
4220
4241
  ```
4221
- ## Update your username
4242
+ ## Edit a transactional template version.
4222
4243
 
4223
- **This endpoint allows you to update the username for your account.**
4244
+ **This endpoint allows you to edit a version of one of your transactional templates.**
4224
4245
 
4225
- Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to.
4246
+ 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.
4226
4247
 
4227
- For more information about your user profile:
4248
+ For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
4228
4249
 
4229
- * [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
4250
+ ## URI Parameters
4251
+ | URI Parameter | Type | Description |
4252
+ |---|---|---|
4253
+ | template_id | string | The ID of the original template |
4254
+ | version_id | string | The ID of the template version |
4230
4255
 
4231
- ### PUT /user/username
4256
+ ### PATCH /templates/{template_id}/versions/{version_id}
4232
4257
 
4233
4258
 
4234
4259
  ```ruby
4235
4260
  data = JSON.parse('{
4236
- "username": "test_username"
4261
+ "active": 1,
4262
+ "html_content": "<%body%>",
4263
+ "name": "updated_example_name",
4264
+ "plain_content": "<%body%>",
4265
+ "subject": "<%subject%>"
4237
4266
  }')
4238
- response = sg.client.user.username.put(request_body: data)
4267
+ template_id = "test_url_param"
4268
+ version_id = "test_url_param"
4269
+ response = sg.client.templates._(template_id).versions._(version_id).patch(request_body: data)
4239
4270
  puts response.status_code
4240
4271
  puts response.body
4241
4272
  puts response.headers
4242
4273
  ```
4243
- ## Retrieve your username
4274
+ ## Retrieve a specific transactional template version.
4244
4275
 
4245
- **This endpoint allows you to retrieve your current account username.**
4276
+ **This endpoint allows you to retrieve a specific version of a template.**
4246
4277
 
4247
- Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to.
4278
+ 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.
4248
4279
 
4249
- For more information about your user profile:
4280
+ For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
4250
4281
 
4251
- * [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
4282
+ ## URI Parameters
4283
+ | URI Parameter | Type | Description |
4284
+ |---|---|---|
4285
+ | template_id | string | The ID of the original template |
4286
+ | version_id | string | The ID of the template version |
4252
4287
 
4253
- ### GET /user/username
4288
+ ### GET /templates/{template_id}/versions/{version_id}
4254
4289
 
4255
4290
 
4256
4291
  ```ruby
4257
- response = sg.client.user.username.get()
4292
+ template_id = "test_url_param"
4293
+ version_id = "test_url_param"
4294
+ response = sg.client.templates._(template_id).versions._(version_id).get()
4258
4295
  puts response.status_code
4259
4296
  puts response.body
4260
4297
  puts response.headers
4261
4298
  ```
4262
- ## Update Event Notification Settings
4299
+ ## Delete a transactional template version.
4263
4300
 
4264
- **This endpoint allows you to update your current event webhook settings.**
4301
+ **This endpoint allows you to delete one of your transactional template versions.**
4265
4302
 
4266
- If an event type is marked as `true`, then the event webhook will include information about that event.
4303
+ 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.
4267
4304
 
4268
- SendGrids Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email.
4305
+ For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
4269
4306
 
4270
- Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program.
4307
+ ## URI Parameters
4308
+ | URI Parameter | Type | Description |
4309
+ |---|---|---|
4310
+ | template_id | string | The ID of the original template |
4311
+ | version_id | string | The ID of the template version |
4271
4312
 
4272
- ### PATCH /user/webhooks/event/settings
4313
+ ### DELETE /templates/{template_id}/versions/{version_id}
4273
4314
 
4274
4315
 
4275
4316
  ```ruby
4276
- data = JSON.parse('{
4277
- "bounce": true,
4278
- "click": true,
4279
- "deferred": true,
4280
- "delivered": true,
4281
- "dropped": true,
4282
- "enabled": true,
4283
- "group_resubscribe": true,
4284
- "group_unsubscribe": true,
4285
- "open": true,
4286
- "processed": true,
4287
- "spam_report": true,
4288
- "unsubscribe": true,
4289
- "url": "url"
4290
- }')
4291
- response = sg.client.user.webhooks.event.settings.patch(request_body: data)
4317
+ template_id = "test_url_param"
4318
+ version_id = "test_url_param"
4319
+ response = sg.client.templates._(template_id).versions._(version_id).delete()
4292
4320
  puts response.status_code
4293
4321
  puts response.body
4294
4322
  puts response.headers
4295
4323
  ```
4296
- ## Retrieve Event Webhook settings
4324
+ ## Activate a transactional template version.
4297
4325
 
4298
- **This endpoint allows you to retrieve your current event webhook settings.**
4326
+ **This endpoint allows you to activate a version of one of your templates.**
4299
4327
 
4300
- If an event type is marked as `true`, then the event webhook will include information about that event.
4328
+ 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.
4301
4329
 
4302
- SendGrids Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email.
4303
4330
 
4304
- Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program.
4331
+ For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
4305
4332
 
4306
- ### GET /user/webhooks/event/settings
4333
+ ## URI Parameters
4334
+ | URI Parameter | Type | Description |
4335
+ |---|---|---|
4336
+ | template_id | string | The ID of the original template |
4337
+ | version_id | string | The ID of the template version |
4338
+
4339
+ ### POST /templates/{template_id}/versions/{version_id}/activate
4307
4340
 
4308
4341
 
4309
4342
  ```ruby
4310
- response = sg.client.user.webhooks.event.settings.get()
4343
+ template_id = "test_url_param"
4344
+ version_id = "test_url_param"
4345
+ response = sg.client.templates._(template_id).versions._(version_id).activate.post()
4311
4346
  puts response.status_code
4312
4347
  puts response.body
4313
4348
  puts response.headers
4314
4349
  ```
4315
- ## Test Event Notification Settings
4350
+ <a name="tracking-settings"></a>
4351
+ # TRACKING SETTINGS
4316
4352
 
4317
- **This endpoint allows you to test your event webhook by sending a fake event notification post to the provided URL.**
4353
+ ## Retrieve Tracking Settings
4318
4354
 
4319
- SendGrids Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email.
4355
+ **This endpoint allows you to retrieve a list of all tracking settings that you can enable on your account.**
4320
4356
 
4321
- Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program.
4357
+ You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
4322
4358
 
4323
- ### POST /user/webhooks/event/test
4359
+ For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
4360
+
4361
+ ### GET /tracking_settings
4324
4362
 
4325
4363
 
4326
4364
  ```ruby
4327
- data = JSON.parse('{
4328
- "url": "url"
4329
- }')
4330
- response = sg.client.user.webhooks.event.test.post(request_body: data)
4365
+ params = JSON.parse('{"limit": 1, "offset": 1}')
4366
+ response = sg.client.tracking_settings.get(query_params: params)
4331
4367
  puts response.status_code
4332
4368
  puts response.body
4333
4369
  puts response.headers
4334
4370
  ```
4335
- ## Create a parse setting
4371
+ ## Update Click Tracking Settings
4336
4372
 
4337
- **This endpoint allows you to create a new inbound parse setting.**
4373
+ **This endpoint allows you to change your current click tracking setting. You can enable, or disable, click tracking using this endpoint.**
4338
4374
 
4339
- 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).
4375
+ You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
4340
4376
 
4341
- ### POST /user/webhooks/parse/settings
4377
+ For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
4378
+
4379
+ ### PATCH /tracking_settings/click
4342
4380
 
4343
4381
 
4344
4382
  ```ruby
4345
4383
  data = JSON.parse('{
4346
- "hostname": "myhostname.com",
4347
- "send_raw": false,
4348
- "spam_check": true,
4349
- "url": "http://email.myhosthame.com"
4384
+ "enabled": true
4350
4385
  }')
4351
- response = sg.client.user.webhooks.parse.settings.post(request_body: data)
4386
+ response = sg.client.tracking_settings.click.patch(request_body: data)
4352
4387
  puts response.status_code
4353
4388
  puts response.body
4354
4389
  puts response.headers
4355
4390
  ```
4356
- ## Retrieve all parse settings
4391
+ ## Retrieve Click Track Settings
4357
4392
 
4358
- **This endpoint allows you to retrieve all of your current inbound parse settings.**
4393
+ **This endpoint allows you to retrieve your current click tracking setting.**
4359
4394
 
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).
4395
+ You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
4361
4396
 
4362
- ### GET /user/webhooks/parse/settings
4397
+ For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
4398
+
4399
+ ### GET /tracking_settings/click
4363
4400
 
4364
4401
 
4365
4402
  ```ruby
4366
- response = sg.client.user.webhooks.parse.settings.get()
4403
+ response = sg.client.tracking_settings.click.get()
4367
4404
  puts response.status_code
4368
4405
  puts response.body
4369
4406
  puts response.headers
4370
4407
  ```
4371
- ## Update a parse setting
4408
+ ## Update Google Analytics Settings
4372
4409
 
4373
- **This endpoint allows you to update a specific inbound parse setting.**
4410
+ **This endpoint allows you to update your current setting for Google Analytics.**
4374
4411
 
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).
4412
+ For more information about using Google Analytics, please refer to [Googles URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on ["Best Practices for Campaign Building"](https://support.google.com/analytics/answer/1037445).
4376
4413
 
4377
- ### PATCH /user/webhooks/parse/settings/{hostname}
4414
+ We default the settings to Googles recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/google_analytics_demystified_ga_statistics_vs_sg_statistics.html).
4415
+
4416
+ You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
4417
+
4418
+ For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
4419
+
4420
+ ### PATCH /tracking_settings/google_analytics
4378
4421
 
4379
4422
 
4380
4423
  ```ruby
4381
4424
  data = JSON.parse('{
4382
- "send_raw": true,
4383
- "spam_check": false,
4384
- "url": "http://newdomain.com/parse"
4425
+ "enabled": true,
4426
+ "utm_campaign": "website",
4427
+ "utm_content": "",
4428
+ "utm_medium": "email",
4429
+ "utm_source": "sendgrid.com",
4430
+ "utm_term": ""
4385
4431
  }')
4386
- hostname = "test_url_param"
4387
- response = sg.client.user.webhooks.parse.settings._(hostname).patch(request_body: data)
4432
+ response = sg.client.tracking_settings.google_analytics.patch(request_body: data)
4388
4433
  puts response.status_code
4389
4434
  puts response.body
4390
4435
  puts response.headers
4391
4436
  ```
4392
- ## Retrieve a specific parse setting
4393
-
4394
- **This endpoint allows you to retrieve a specific inbound parse setting.**
4395
-
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).
4437
+ ## Retrieve Google Analytics Settings
4397
4438
 
4398
- ### GET /user/webhooks/parse/settings/{hostname}
4439
+ **This endpoint allows you to retrieve your current setting for Google Analytics.**
4399
4440
 
4441
+ For more information about using Google Analytics, please refer to [Googles URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on ["Best Practices for Campaign Building"](https://support.google.com/analytics/answer/1037445).
4400
4442
 
4401
- ```ruby
4402
- hostname = "test_url_param"
4403
- response = sg.client.user.webhooks.parse.settings._(hostname).get()
4404
- puts response.status_code
4405
- puts response.body
4406
- puts response.headers
4407
- ```
4408
- ## Delete a parse setting
4443
+ We default the settings to Googles recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/google_analytics_demystified_ga_statistics_vs_sg_statistics.html).
4409
4444
 
4410
- **This endpoint allows you to delete a specific inbound parse setting.**
4445
+ You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
4411
4446
 
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).
4447
+ For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
4413
4448
 
4414
- ### DELETE /user/webhooks/parse/settings/{hostname}
4449
+ ### GET /tracking_settings/google_analytics
4415
4450
 
4416
4451
 
4417
4452
  ```ruby
4418
- hostname = "test_url_param"
4419
- response = sg.client.user.webhooks.parse.settings._(hostname).delete()
4453
+ response = sg.client.tracking_settings.google_analytics.get()
4420
4454
  puts response.status_code
4421
4455
  puts response.body
4422
4456
  puts response.headers
4423
4457
  ```
4424
- ## Retrieves Inbound Parse Webhook statistics.
4458
+ ## Update Open Tracking Settings
4425
4459
 
4426
- **This endpoint allows you to retrieve the statistics for your Parse Webhook usage.**
4460
+ **This endpoint allows you to update your current settings for open tracking.**
4427
4461
 
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.
4462
+ Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to Twilio SendGrid's server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook.
4463
+
4464
+ You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
4429
4465
 
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).
4466
+ For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
4431
4467
 
4432
- ### GET /user/webhooks/parse/stats
4468
+ ### PATCH /tracking_settings/open
4433
4469
 
4434
4470
 
4435
4471
  ```ruby
4436
- params = JSON.parse('{"aggregated_by": "day", "limit": "test_string", "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": "test_string"}')
4437
- response = sg.client.user.webhooks.parse.stats.get(query_params: params)
4472
+ data = JSON.parse('{
4473
+ "enabled": true
4474
+ }')
4475
+ response = sg.client.tracking_settings.open.patch(request_body: data)
4438
4476
  puts response.status_code
4439
4477
  puts response.body
4440
4478
  puts response.headers
4441
4479
  ```
4442
- <a name="whitelabel"></a>
4443
- # WHITELABEL
4444
-
4445
- ## Create a domain whitelabel.
4480
+ ## Get Open Tracking Settings
4446
4481
 
4447
- **This endpoint allows you to create a whitelabel for one of your domains.**
4482
+ **This endpoint allows you to retrieve your current settings for open tracking.**
4448
4483
 
4449
- If you are creating a domain whitelabel that you would like a subuser to use, you have two options:
4450
- 1. Use the "username" parameter. This allows you to create a whitelabel on behalf of your subuser. This means the subuser is able to see and modify the created whitelabel.
4451
- 2. Use the Association workflow (see Associate Domain section). This allows you to assign a whitelabel created by the parent to a subuser. This means the subuser will default to the assigned whitelabel, but will not be able to see or modify that whitelabel. However, if the subuser creates their own whitelabel it will overwrite the assigned whitelabel.
4484
+ Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to Twilio SendGrid's server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook.
4452
4485
 
4453
- 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.
4486
+ You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
4454
4487
 
4455
- For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)
4488
+ For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
4456
4489
 
4457
- ### POST /whitelabel/domains
4490
+ ### GET /tracking_settings/open
4458
4491
 
4459
4492
 
4460
4493
  ```ruby
4461
- data = JSON.parse('{
4462
- "automatic_security": false,
4463
- "custom_spf": true,
4464
- "default": true,
4465
- "domain": "example.com",
4466
- "ips": [
4467
- "192.168.1.1",
4468
- "192.168.1.2"
4469
- ],
4470
- "subdomain": "news",
4471
- "username": "john@example.com"
4472
- }')
4473
- response = sg.client.whitelabel.domains.post(request_body: data)
4494
+ response = sg.client.tracking_settings.open.get()
4474
4495
  puts response.status_code
4475
4496
  puts response.body
4476
4497
  puts response.headers
4477
4498
  ```
4478
- ## List all domain whitelabels.
4499
+ ## Update Subscription Tracking Settings
4479
4500
 
4480
- **This endpoint allows you to retrieve a list of all domain whitelabels you have created.**
4501
+ **This endpoint allows you to update your current settings for subscription tracking.**
4481
4502
 
4482
- 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.
4503
+ Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails.
4483
4504
 
4484
- For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)
4505
+ You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
4485
4506
 
4507
+ For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
4486
4508
 
4487
- ### GET /whitelabel/domains
4509
+ ### PATCH /tracking_settings/subscription
4488
4510
 
4489
4511
 
4490
4512
  ```ruby
4491
- params = JSON.parse('{"username": "test_string", "domain": "test_string", "exclude_subusers": "true", "limit": 1, "offset": 1}')
4492
- response = sg.client.whitelabel.domains.get(query_params: params)
4513
+ data = JSON.parse('{
4514
+ "enabled": true,
4515
+ "html_content": "html content",
4516
+ "landing": "landing page html",
4517
+ "plain_content": "text content",
4518
+ "replace": "replacement tag",
4519
+ "url": "url"
4520
+ }')
4521
+ response = sg.client.tracking_settings.subscription.patch(request_body: data)
4493
4522
  puts response.status_code
4494
4523
  puts response.body
4495
4524
  puts response.headers
4496
4525
  ```
4497
- ## Get the default domain whitelabel.
4526
+ ## Retrieve Subscription Tracking Settings
4498
4527
 
4499
- **This endpoint allows you to retrieve the default whitelabel for a domain.**
4528
+ **This endpoint allows you to retrieve your current settings for subscription tracking.**
4500
4529
 
4501
- 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.
4530
+ Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails.
4502
4531
 
4503
- For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)
4532
+ You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
4504
4533
 
4505
- ## URI Parameters
4506
- | URI Parameter | Type | Description |
4507
- |---|---|---|
4508
- | domain | string |The domain to find a default domain whitelabel for. |
4534
+ For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
4509
4535
 
4510
- ### GET /whitelabel/domains/default
4536
+ ### GET /tracking_settings/subscription
4511
4537
 
4512
4538
 
4513
4539
  ```ruby
4514
- response = sg.client.whitelabel.domains.default.get()
4540
+ response = sg.client.tracking_settings.subscription.get()
4515
4541
  puts response.status_code
4516
4542
  puts response.body
4517
4543
  puts response.headers
4518
4544
  ```
4519
- ## List the domain whitelabel associated with the given user.
4545
+ <a name="user"></a>
4546
+ # USER
4520
4547
 
4521
- **This endpoint allows you to retrieve all of the whitelabels that have been assigned to a specific subuser.**
4548
+ ## Get a user's account information.
4522
4549
 
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.
4550
+ **This endpoint allows you to retrieve your user account details.**
4524
4551
 
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.
4552
+ Your user's account information includes the user's account type and reputation.
4526
4553
 
4527
- For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)
4554
+ Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to.
4528
4555
 
4529
- ## URI Parameters
4530
- | URI Parameter | Type | Description |
4531
- |---|---|---|
4532
- | username | string | Username of the subuser to find associated whitelabels for. |
4556
+ For more information about your user profile:
4533
4557
 
4534
- ### GET /whitelabel/domains/subuser
4558
+ * [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
4559
+
4560
+ ### GET /user/account
4535
4561
 
4536
4562
 
4537
4563
  ```ruby
4538
- response = sg.client.whitelabel.domains.subuser.get()
4564
+ response = sg.client.user.account.get()
4539
4565
  puts response.status_code
4540
4566
  puts response.body
4541
4567
  puts response.headers
4542
4568
  ```
4543
- ## Disassociate a domain whitelabel from a given user.
4544
-
4545
- **This endpoint allows you to disassociate a specific whitelabel from a subuser.**
4546
-
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
-
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.
4569
+ ## Retrieve your credit balance
4550
4570
 
4551
- For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)
4571
+ **This endpoint allows you to retrieve the current credit balance for your account.**
4552
4572
 
4553
- ## URI Parameters
4554
- | URI Parameter | Type | Required? | Description |
4555
- |---|---|---|---|
4556
- | username | string | required | Username for the subuser to find associated whitelabels for. |
4573
+ 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).
4557
4574
 
4558
- ### DELETE /whitelabel/domains/subuser
4575
+ ### GET /user/credits
4559
4576
 
4560
4577
 
4561
4578
  ```ruby
4562
- response = sg.client.whitelabel.domains.subuser.delete()
4579
+ response = sg.client.user.credits.get()
4563
4580
  puts response.status_code
4564
4581
  puts response.body
4565
4582
  puts response.headers
4566
4583
  ```
4567
- ## Update a domain whitelabel.
4584
+ ## Update your account email address
4568
4585
 
4569
- **This endpoint allows you to update the settings for a domain whitelabel.**
4586
+ **This endpoint allows you to update the email address currently on file for your account.**
4587
+
4588
+ Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to.
4570
4589
 
4571
- 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.
4590
+ For more information about your user profile:
4572
4591
 
4573
- For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)
4592
+ * [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
4574
4593
 
4575
- ### PATCH /whitelabel/domains/{domain_id}
4594
+ ### PUT /user/email
4576
4595
 
4577
4596
 
4578
4597
  ```ruby
4579
4598
  data = JSON.parse('{
4580
- "custom_spf": true,
4581
- "default": false
4599
+ "email": "example@example.com"
4582
4600
  }')
4583
- domain_id = "test_url_param"
4584
- response = sg.client.whitelabel.domains._(domain_id).patch(request_body: data)
4601
+ response = sg.client.user.email.put(request_body: data)
4585
4602
  puts response.status_code
4586
4603
  puts response.body
4587
4604
  puts response.headers
4588
4605
  ```
4589
- ## Retrieve a domain whitelabel.
4606
+ ## Retrieve your account email address
4590
4607
 
4591
- **This endpoint allows you to retrieve a specific domain whitelabel.**
4608
+ **This endpoint allows you to retrieve the email address currently on file for your account.**
4592
4609
 
4593
- 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.
4610
+ Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to.
4594
4611
 
4595
- For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)
4612
+ For more information about your user profile:
4596
4613
 
4614
+ * [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
4597
4615
 
4598
- ### GET /whitelabel/domains/{domain_id}
4616
+ ### GET /user/email
4599
4617
 
4600
4618
 
4601
4619
  ```ruby
4602
- domain_id = "test_url_param"
4603
- response = sg.client.whitelabel.domains._(domain_id).get()
4620
+ response = sg.client.user.email.get()
4604
4621
  puts response.status_code
4605
4622
  puts response.body
4606
4623
  puts response.headers
4607
4624
  ```
4608
- ## Delete a domain whitelabel.
4625
+ ## Update your password
4609
4626
 
4610
- **This endpoint allows you to delete a domain whitelabel.**
4627
+ **This endpoint allows you to update your password.**
4628
+
4629
+ Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to.
4611
4630
 
4612
- 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
+ For more information about your user profile:
4613
4632
 
4614
- For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)
4633
+ * [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
4615
4634
 
4616
- ### DELETE /whitelabel/domains/{domain_id}
4635
+ ### PUT /user/password
4617
4636
 
4618
4637
 
4619
4638
  ```ruby
4620
- domain_id = "test_url_param"
4621
- response = sg.client.whitelabel.domains._(domain_id).delete()
4639
+ data = JSON.parse('{
4640
+ "new_password": "new_password",
4641
+ "old_password": "old_password"
4642
+ }')
4643
+ response = sg.client.user.password.put(request_body: data)
4622
4644
  puts response.status_code
4623
4645
  puts response.body
4624
4646
  puts response.headers
4625
4647
  ```
4626
- ## Associate a domain whitelabel with a given user.
4648
+ ## Update a user's profile
4627
4649
 
4628
- **This endpoint allows you to associate a specific domain whitelabel with a subuser.**
4650
+ **This endpoint allows you to update your current profile details.**
4629
4651
 
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.
4652
+ Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to.
4631
4653
 
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.
4654
+ For more information about your user profile:
4633
4655
 
4634
- For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)
4656
+ * [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
4635
4657
 
4636
- ## URI Parameters
4637
- | URI Parameter | Type | Description |
4638
- |---|---|---|
4639
- | domain_id | integer | ID of the domain whitelabel to associate with the subuser. |
4658
+ It should be noted that any one or more of the parameters can be updated via the PATCH /user/profile endpoint. The only requirement is that you include at least one when you PATCH.
4640
4659
 
4641
- ### POST /whitelabel/domains/{domain_id}/subuser
4660
+ ### PATCH /user/profile
4642
4661
 
4643
4662
 
4644
4663
  ```ruby
4645
4664
  data = JSON.parse('{
4646
- "username": "jane@example.com"
4665
+ "city": "Orange",
4666
+ "first_name": "Example",
4667
+ "last_name": "User"
4647
4668
  }')
4648
- domain_id = "test_url_param"
4649
- response = sg.client.whitelabel.domains._(domain_id).subuser.post(request_body: data)
4669
+ response = sg.client.user.profile.patch(request_body: data)
4650
4670
  puts response.status_code
4651
4671
  puts response.body
4652
4672
  puts response.headers
4653
4673
  ```
4654
- ## Add an IP to a domain whitelabel.
4655
-
4656
- **This endpoint allows you to add an IP address to a domain whitelabel.**
4674
+ ## Get a user's profile
4657
4675
 
4658
- 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.
4676
+ Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to.
4659
4677
 
4660
- For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)
4678
+ For more information about your user profile:
4661
4679
 
4662
- ## URI Parameters
4663
- | URI Parameter | Type | Description |
4664
- |---|---|---|
4665
- | id | integer | ID of the domain to which you are adding an IP |
4680
+ * [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
4666
4681
 
4667
- ### POST /whitelabel/domains/{id}/ips
4682
+ ### GET /user/profile
4668
4683
 
4669
4684
 
4670
4685
  ```ruby
4671
- data = JSON.parse('{
4672
- "ip": "192.168.0.1"
4673
- }')
4674
- id = "test_url_param"
4675
- response = sg.client.whitelabel.domains._(id).ips.post(request_body: data)
4686
+ response = sg.client.user.profile.get()
4676
4687
  puts response.status_code
4677
4688
  puts response.body
4678
4689
  puts response.headers
4679
4690
  ```
4680
- ## Remove an IP from a domain whitelabel.
4681
-
4682
- **This endpoint allows you to remove a domain's IP address from that domain's whitelabel.**
4691
+ ## Cancel or pause a scheduled send
4683
4692
 
4684
- 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.
4693
+ **This endpoint allows you to cancel or pause an email that has been scheduled to be sent.**
4685
4694
 
4686
- For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)
4695
+ If the maximum number of cancellations/pauses are added, HTTP 400 will
4696
+ be returned.
4687
4697
 
4688
- ## URI Parameters
4689
- | URI Parameter | Type | Description |
4690
- |---|---|---|
4691
- | id | integer | ID of the domain whitelabel to delete the IP from. |
4692
- | ip | string | IP to remove from the domain whitelabel. |
4698
+ The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.
4693
4699
 
4694
- ### DELETE /whitelabel/domains/{id}/ips/{ip}
4700
+ ### POST /user/scheduled_sends
4695
4701
 
4696
4702
 
4697
4703
  ```ruby
4698
- id = "test_url_param"
4699
- ip = "test_url_param"
4700
- response = sg.client.whitelabel.domains._(id).ips._(ip).delete()
4704
+ data = JSON.parse('{
4705
+ "batch_id": "YOUR_BATCH_ID",
4706
+ "status": "pause"
4707
+ }')
4708
+ response = sg.client.user.scheduled_sends.post(request_body: data)
4701
4709
  puts response.status_code
4702
4710
  puts response.body
4703
4711
  puts response.headers
4704
4712
  ```
4705
- ## Validate a domain whitelabel.
4706
-
4707
- **This endpoint allows you to validate a domain whitelabel. If it fails, it will return an error message describing why the whitelabel could not be validated.**
4708
-
4709
- 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.
4713
+ ## Retrieve all scheduled sends
4710
4714
 
4711
- For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)
4715
+ **This endpoint allows you to retrieve all cancel/paused scheduled send information.**
4712
4716
 
4713
- ## URI Parameters
4714
- | URI Parameter | Type | Description |
4715
- |---|---|---|
4716
- | id | integer |ID of the domain whitelabel to validate. |
4717
+ The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.
4717
4718
 
4718
- ### POST /whitelabel/domains/{id}/validate
4719
+ ### GET /user/scheduled_sends
4719
4720
 
4720
4721
 
4721
4722
  ```ruby
4722
- id = "test_url_param"
4723
- response = sg.client.whitelabel.domains._(id).validate.post()
4723
+ response = sg.client.user.scheduled_sends.get()
4724
4724
  puts response.status_code
4725
4725
  puts response.body
4726
4726
  puts response.headers
4727
4727
  ```
4728
- ## Create an IP whitelabel
4729
-
4730
- **This endpoint allows you to create an IP whitelabel.**
4731
-
4732
- When creating an IP whitelable, you should use the same subdomain that you used when you created a domain whitelabel.
4728
+ ## Update user scheduled send information
4733
4729
 
4734
- A IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.
4730
+ **This endpoint allows you to update the status of a scheduled send for the given `batch_id`.**
4735
4731
 
4736
- For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html).
4732
+ The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.
4737
4733
 
4738
- ### POST /whitelabel/ips
4734
+ ### PATCH /user/scheduled_sends/{batch_id}
4739
4735
 
4740
4736
 
4741
4737
  ```ruby
4742
4738
  data = JSON.parse('{
4743
- "domain": "example.com",
4744
- "ip": "192.168.1.1",
4745
- "subdomain": "email"
4739
+ "status": "pause"
4746
4740
  }')
4747
- response = sg.client.whitelabel.ips.post(request_body: data)
4741
+ batch_id = "test_url_param"
4742
+ response = sg.client.user.scheduled_sends._(batch_id).patch(request_body: data)
4748
4743
  puts response.status_code
4749
4744
  puts response.body
4750
4745
  puts response.headers
4751
4746
  ```
4752
- ## Retrieve all IP whitelabels
4753
-
4754
- **This endpoint allows you to retrieve all of the IP whitelabels that have been created by this account.**
4755
-
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.").
4747
+ ## Retrieve scheduled send
4757
4748
 
4758
- A IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.
4749
+ **This endpoint allows you to retrieve the cancel/paused scheduled send information for a specific `batch_id`.**
4759
4750
 
4760
- For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html).
4751
+ The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.
4761
4752
 
4762
- ### GET /whitelabel/ips
4753
+ ### GET /user/scheduled_sends/{batch_id}
4763
4754
 
4764
4755
 
4765
4756
  ```ruby
4766
- params = JSON.parse('{"ip": "test_string", "limit": 1, "offset": 1}')
4767
- response = sg.client.whitelabel.ips.get(query_params: params)
4757
+ batch_id = "test_url_param"
4758
+ response = sg.client.user.scheduled_sends._(batch_id).get()
4768
4759
  puts response.status_code
4769
4760
  puts response.body
4770
4761
  puts response.headers
4771
4762
  ```
4772
- ## Retrieve an IP whitelabel
4773
-
4774
- **This endpoint allows you to retrieve an IP whitelabel.**
4763
+ ## Delete a cancellation or pause of a scheduled send
4775
4764
 
4776
- A IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.
4765
+ **This endpoint allows you to delete the cancellation/pause of a scheduled send.**
4777
4766
 
4778
- For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html).
4767
+ The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.
4779
4768
 
4780
- ### GET /whitelabel/ips/{id}
4769
+ ### DELETE /user/scheduled_sends/{batch_id}
4781
4770
 
4782
4771
 
4783
4772
  ```ruby
4784
- id = "test_url_param"
4785
- response = sg.client.whitelabel.ips._(id).get()
4773
+ batch_id = "test_url_param"
4774
+ response = sg.client.user.scheduled_sends._(batch_id).delete()
4786
4775
  puts response.status_code
4787
4776
  puts response.body
4788
4777
  puts response.headers
4789
4778
  ```
4790
- ## Delete an IP whitelabel
4779
+ ## Update Enforced TLS settings
4791
4780
 
4792
- **This endpoint allows you to delete an IP whitelabel.**
4781
+ **This endpoint allows you to update your current Enforced TLS settings.**
4793
4782
 
4794
- A IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.
4783
+ The Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate. See the [SMTP Ports User Guide](https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html) for more information on opportunistic TLS.
4795
4784
 
4796
- For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html).
4785
+ **Note:** If either setting is enabled and the recipient does not support TLS or have a valid certificate, we drop the message and send a block event with TLS required but not supported as the description.
4797
4786
 
4798
- ### DELETE /whitelabel/ips/{id}
4787
+ ### PATCH /user/settings/enforced_tls
4799
4788
 
4800
4789
 
4801
4790
  ```ruby
4802
- id = "test_url_param"
4803
- response = sg.client.whitelabel.ips._(id).delete()
4791
+ data = JSON.parse('{
4792
+ "require_tls": true,
4793
+ "require_valid_cert": false
4794
+ }')
4795
+ response = sg.client.user.settings.enforced_tls.patch(request_body: data)
4804
4796
  puts response.status_code
4805
4797
  puts response.body
4806
4798
  puts response.headers
4807
4799
  ```
4808
- ## Validate an IP whitelabel
4800
+ ## Retrieve current Enforced TLS settings.
4809
4801
 
4810
- **This endpoint allows you to validate an IP whitelabel.**
4802
+ **This endpoint allows you to retrieve your current Enforced TLS settings.**
4811
4803
 
4812
- A IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.
4804
+ The Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate. See the [SMTP Ports User Guide](https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html) for more information on opportunistic TLS.
4813
4805
 
4814
- For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html).
4806
+ **Note:** If either setting is enabled and the recipient does not support TLS or have a valid certificate, we drop the message and send a block event with TLS required but not supported as the description.
4815
4807
 
4816
- ### POST /whitelabel/ips/{id}/validate
4808
+ ### GET /user/settings/enforced_tls
4817
4809
 
4818
4810
 
4819
4811
  ```ruby
4820
- id = "test_url_param"
4821
- response = sg.client.whitelabel.ips._(id).validate.post()
4812
+ response = sg.client.user.settings.enforced_tls.get()
4822
4813
  puts response.status_code
4823
4814
  puts response.body
4824
4815
  puts response.headers
4825
4816
  ```
4826
- ## Create a Link Whitelabel
4817
+ ## Update your username
4818
+
4819
+ **This endpoint allows you to update the username for your account.**
4827
4820
 
4828
- **This endpoint allows you to create a new link whitelabel.**
4821
+ Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to.
4829
4822
 
4830
- 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.
4823
+ For more information about your user profile:
4831
4824
 
4832
- For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).
4825
+ * [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
4833
4826
 
4834
- ### POST /whitelabel/links
4827
+ ### PUT /user/username
4835
4828
 
4836
4829
 
4837
4830
  ```ruby
4838
4831
  data = JSON.parse('{
4839
- "default": true,
4840
- "domain": "example.com",
4841
- "subdomain": "mail"
4832
+ "username": "test_username"
4842
4833
  }')
4843
- params = JSON.parse('{"limit": 1, "offset": 1}')
4844
- response = sg.client.whitelabel.links.post(request_body: data, query_params: params)
4834
+ response = sg.client.user.username.put(request_body: data)
4845
4835
  puts response.status_code
4846
4836
  puts response.body
4847
4837
  puts response.headers
4848
4838
  ```
4849
- ## Retrieve all link whitelabels
4839
+ ## Retrieve your username
4840
+
4841
+ **This endpoint allows you to retrieve your current account username.**
4850
4842
 
4851
- **This endpoint allows you to retrieve all link whitelabels.**
4843
+ Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to.
4852
4844
 
4853
- 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.
4845
+ For more information about your user profile:
4854
4846
 
4855
- For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).
4847
+ * [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
4856
4848
 
4857
- ### GET /whitelabel/links
4849
+ ### GET /user/username
4858
4850
 
4859
4851
 
4860
4852
  ```ruby
4861
- params = JSON.parse('{"limit": 1}')
4862
- response = sg.client.whitelabel.links.get(query_params: params)
4853
+ response = sg.client.user.username.get()
4863
4854
  puts response.status_code
4864
4855
  puts response.body
4865
4856
  puts response.headers
4866
4857
  ```
4867
- ## Retrieve a Default Link Whitelabel
4858
+ ## Update Event Notification Settings
4868
4859
 
4869
- **This endpoint allows you to retrieve the default link whitelabel.**
4860
+ **This endpoint allows you to update your current event webhook settings.**
4870
4861
 
4871
- Default link whitelabel is the actual link whitelabel to be used when sending messages. If there are multiple link whitelabels, the default is determined by the following order:
4872
- <ul>
4873
- <li>Validated link whitelabels marked as "default"</li>
4874
- <li>Legacy link whitelabels (migrated from the whitelabel wizard)</li>
4875
- <li>Default SendGrid link whitelabel (i.e. 100.ct.sendgrid.net)</li>
4876
- </ul>
4862
+ If an event type is marked as `true`, then the event webhook will include information about that event.
4877
4863
 
4878
- 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.
4864
+ Twilio SendGrid's Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as Twilio SendGrid processes your email.
4879
4865
 
4880
- For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).
4866
+ Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program.
4881
4867
 
4882
- ### GET /whitelabel/links/default
4868
+ ### PATCH /user/webhooks/event/settings
4883
4869
 
4884
4870
 
4885
4871
  ```ruby
4886
- params = JSON.parse('{"domain": "test_string"}')
4887
- response = sg.client.whitelabel.links.default.get(query_params: params)
4872
+ data = JSON.parse('{
4873
+ "bounce": true,
4874
+ "click": true,
4875
+ "deferred": true,
4876
+ "delivered": true,
4877
+ "dropped": true,
4878
+ "enabled": true,
4879
+ "group_resubscribe": true,
4880
+ "group_unsubscribe": true,
4881
+ "open": true,
4882
+ "processed": true,
4883
+ "spam_report": true,
4884
+ "unsubscribe": true,
4885
+ "url": "url"
4886
+ }')
4887
+ response = sg.client.user.webhooks.event.settings.patch(request_body: data)
4888
4888
  puts response.status_code
4889
4889
  puts response.body
4890
4890
  puts response.headers
4891
4891
  ```
4892
- ## Retrieve Associated Link Whitelabel
4892
+ ## Retrieve Event Webhook settings
4893
4893
 
4894
- **This endpoint allows you to retrieve the associated link whitelabel for a subuser.**
4894
+ **This endpoint allows you to retrieve your current event webhook settings.**
4895
4895
 
4896
- Link whitelables can be associated with subusers from the parent account. This functionality allows
4897
- subusers to send mail using their parent's link whitelabels. To associate a link whitelabel, the parent account
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.
4896
+ If an event type is marked as `true`, then the event webhook will include information about that event.
4899
4897
 
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.
4898
+ Twilio SendGrid's Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as Twilio SendGrid processes your email.
4901
4899
 
4902
- For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).
4900
+ Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program.
4903
4901
 
4904
- ### GET /whitelabel/links/subuser
4902
+ ### GET /user/webhooks/event/settings
4905
4903
 
4906
4904
 
4907
4905
  ```ruby
4908
- params = JSON.parse('{"username": "test_string"}')
4909
- response = sg.client.whitelabel.links.subuser.get(query_params: params)
4906
+ response = sg.client.user.webhooks.event.settings.get()
4910
4907
  puts response.status_code
4911
4908
  puts response.body
4912
4909
  puts response.headers
4913
4910
  ```
4914
- ## Disassociate a Link Whitelabel
4915
-
4916
- **This endpoint allows you to disassociate a link whitelabel from a subuser.**
4911
+ ## Test Event Notification Settings
4917
4912
 
4918
- Link whitelables can be associated with subusers from the parent account. This functionality allows
4919
- subusers to send mail using their parent's link whitelabels. To associate a link whitelabel, the parent account
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.
4913
+ **This endpoint allows you to test your event webhook by sending a fake event notification post to the provided URL.**
4921
4914
 
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.
4915
+ Twilio SendGrid's Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as Twilio SendGrid processes your email.
4923
4916
 
4924
- For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).
4917
+ Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program.
4925
4918
 
4926
- ### DELETE /whitelabel/links/subuser
4919
+ ### POST /user/webhooks/event/test
4927
4920
 
4928
4921
 
4929
4922
  ```ruby
4930
- params = JSON.parse('{"username": "test_string"}')
4931
- response = sg.client.whitelabel.links.subuser.delete(query_params: params)
4923
+ data = JSON.parse('{
4924
+ "url": "url"
4925
+ }')
4926
+ response = sg.client.user.webhooks.event.test.post(request_body: data)
4932
4927
  puts response.status_code
4933
4928
  puts response.body
4934
4929
  puts response.headers
4935
4930
  ```
4936
- ## Update a Link Whitelabel
4937
-
4938
- **This endpoint allows you to update a specific link whitelabel. You can use this endpoint to change a link whitelabel's default status.**
4931
+ ## Create a parse setting
4939
4932
 
4940
- 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.
4933
+ **This endpoint allows you to create a new inbound parse setting.**
4941
4934
 
4942
- For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).
4935
+ 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 Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html).
4943
4936
 
4944
- ### PATCH /whitelabel/links/{id}
4937
+ ### POST /user/webhooks/parse/settings
4945
4938
 
4946
4939
 
4947
4940
  ```ruby
4948
4941
  data = JSON.parse('{
4949
- "default": true
4942
+ "hostname": "myhostname.com",
4943
+ "send_raw": false,
4944
+ "spam_check": true,
4945
+ "url": "http://email.myhosthame.com"
4950
4946
  }')
4951
- id = "test_url_param"
4952
- response = sg.client.whitelabel.links._(id).patch(request_body: data)
4947
+ response = sg.client.user.webhooks.parse.settings.post(request_body: data)
4953
4948
  puts response.status_code
4954
4949
  puts response.body
4955
4950
  puts response.headers
4956
4951
  ```
4957
- ## Retrieve a Link Whitelabel
4958
-
4959
- **This endpoint allows you to retrieve a specific link whitelabel.**
4952
+ ## Retrieve all parse settings
4960
4953
 
4961
- 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.
4954
+ **This endpoint allows you to retrieve all of your current inbound parse settings.**
4962
4955
 
4963
- For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).
4956
+ 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 Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html).
4964
4957
 
4965
- ### GET /whitelabel/links/{id}
4958
+ ### GET /user/webhooks/parse/settings
4966
4959
 
4967
4960
 
4968
4961
  ```ruby
4969
- id = "test_url_param"
4970
- response = sg.client.whitelabel.links._(id).get()
4962
+ response = sg.client.user.webhooks.parse.settings.get()
4971
4963
  puts response.status_code
4972
4964
  puts response.body
4973
4965
  puts response.headers
4974
4966
  ```
4975
- ## Delete a Link Whitelabel
4976
-
4977
- **This endpoint allows you to delete a link whitelabel.**
4967
+ ## Update a parse setting
4978
4968
 
4979
- 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.
4969
+ **This endpoint allows you to update a specific inbound parse setting.**
4980
4970
 
4981
- For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).
4971
+ 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 Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html).
4982
4972
 
4983
- ### DELETE /whitelabel/links/{id}
4973
+ ### PATCH /user/webhooks/parse/settings/{hostname}
4984
4974
 
4985
4975
 
4986
4976
  ```ruby
4987
- id = "test_url_param"
4988
- response = sg.client.whitelabel.links._(id).delete()
4977
+ data = JSON.parse('{
4978
+ "send_raw": true,
4979
+ "spam_check": false,
4980
+ "url": "http://newdomain.com/parse"
4981
+ }')
4982
+ hostname = "test_url_param"
4983
+ response = sg.client.user.webhooks.parse.settings._(hostname).patch(request_body: data)
4989
4984
  puts response.status_code
4990
4985
  puts response.body
4991
4986
  puts response.headers
4992
4987
  ```
4993
- ## Validate a Link Whitelabel
4994
-
4995
- **This endpoint allows you to validate a link whitelabel.**
4988
+ ## Retrieve a specific parse setting
4996
4989
 
4997
- 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.
4990
+ **This endpoint allows you to retrieve a specific inbound parse setting.**
4998
4991
 
4999
- For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).
4992
+ 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 Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html).
5000
4993
 
5001
- ### POST /whitelabel/links/{id}/validate
4994
+ ### GET /user/webhooks/parse/settings/{hostname}
5002
4995
 
5003
4996
 
5004
4997
  ```ruby
5005
- id = "test_url_param"
5006
- response = sg.client.whitelabel.links._(id).validate.post()
4998
+ hostname = "test_url_param"
4999
+ response = sg.client.user.webhooks.parse.settings._(hostname).get()
5007
5000
  puts response.status_code
5008
5001
  puts response.body
5009
5002
  puts response.headers
5010
5003
  ```
5011
- ## Associate a Link Whitelabel
5004
+ ## Delete a parse setting
5012
5005
 
5013
- **This endpoint allows you to associate a link whitelabel with a subuser account.**
5006
+ **This endpoint allows you to delete a specific inbound parse setting.**
5014
5007
 
5015
- Link whitelables can be associated with subusers from the parent account. This functionality allows
5016
- subusers to send mail using their parent's link whitelabels. To associate a link whitelabel, the parent account
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.
5008
+ 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 Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html).
5018
5009
 
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.
5010
+ ### DELETE /user/webhooks/parse/settings/{hostname}
5020
5011
 
5021
- For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).
5022
5012
 
5023
- ### POST /whitelabel/links/{link_id}/subuser
5013
+ ```ruby
5014
+ hostname = "test_url_param"
5015
+ response = sg.client.user.webhooks.parse.settings._(hostname).delete()
5016
+ puts response.status_code
5017
+ puts response.body
5018
+ puts response.headers
5019
+ ```
5020
+ ## Retrieves Inbound Parse Webhook statistics.
5021
+
5022
+ **This endpoint allows you to retrieve the statistics for your Parse Webhook usage.**
5023
+
5024
+ 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.
5025
+
5026
+ There are a number of pre-made integrations for the Twilio 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).
5027
+
5028
+ ### GET /user/webhooks/parse/stats
5024
5029
 
5025
5030
 
5026
5031
  ```ruby
5027
- data = JSON.parse('{
5028
- "username": "jane@example.com"
5029
- }')
5030
- link_id = "test_url_param"
5031
- response = sg.client.whitelabel.links._(link_id).subuser.post(request_body: data)
5032
+ params = JSON.parse('{"aggregated_by": "day", "limit": "test_string", "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": "test_string"}')
5033
+ response = sg.client.user.webhooks.parse.stats.get(query_params: params)
5032
5034
  puts response.status_code
5033
5035
  puts response.body
5034
5036
  puts response.headers