diff --git a/config/application.php b/config/application.php
index cc527cd15..74ece1b4f 100644
--- a/config/application.php
+++ b/config/application.php
@@ -67,6 +67,8 @@
'MailerSMTPHosts' => null, // When MailerUseSMTP is true: A string host or array of hosts (e.g., 'host1' or array('host1', 'backuphost')).
'MailerSMTPUsername' => null, // When MailerUseSMTP is true: Authorized username for SMTP server.
'MailerSMTPPassword' => null, // When MailerUseSMTP is true: Authorized password for SMTP server (for above user).
+ 'SendGridAPIKey' => null, // SendGrid API Key for sending mail. (https://sendgrid.com/docs/Classroom/Send/How_Emails_Are_Sent/api_keys.html)
+ // If this API Key is set, it will be used instead of the SMTP settings.
'ServerStatusCache' => 2, // Store a cached server status and refresh every X minutes. Default: 2 minutes (value is measured in minutes).
'ServerStatusTimeout' => 2, // For each server, spend X amount of seconds to determine whether it's up or not.
'SessionKey' => 'fluxSessionData', // Shouldn't be changed, just specifies the session key to be used for session data.
diff --git a/lib/Flux/MailerSendGrid.php b/lib/Flux/MailerSendGrid.php
new file mode 100644
index 000000000..710a9f822
--- /dev/null
+++ b/lib/Flux/MailerSendGrid.php
@@ -0,0 +1,72 @@
+pm = $pm = new \SendGrid\Mail\Mail();
+ $this->errLog = self::$errLog;
+ $this->log = self::$log;
+
+ }
+
+ public function send($recipient, $subject, $template, array $templateVars = array())
+ {
+ if (array_key_exists('_ignoreTemplate', $templateVars) && $templateVars['_ignoreTemplate']) {
+ $content = $template;
+ } else {
+ $templatePath = FLUX_DATA_DIR."/templates/$template.php";
+ if (!file_exists($templatePath)) {
+ return false;
+ }
+
+ $find = array();
+ $repl = array();
+
+ foreach ($templateVars as $key => $value) {
+ $find[] = '{'.$key.'}';
+ $repl[] = $value;
+ }
+
+ ob_start();
+ include $templatePath;
+ $content = ob_get_clean();
+
+ if (!empty($find) && !empty($repl)) {
+ $content = str_replace($find, $repl, $content);
+ }
+ }
+ $this->pm->setFrom(Flux::config('MailerFromAddress'), Flux::config('MailerFromName'));
+ $this->pm->AddTo($recipient, $recipient);
+ $this->pm->SetSubject($subject);
+ $this->pm->AddContent("text/html", $content);
+
+ $sendgrid = new \SendGrid(Flux::config('SendGridAPIKey'));
+
+ try {
+ $response = $sendgrid->send($this->pm);
+ self::$log->puts("sent e-mail -- Recipient: $recipient, Subject: $subject");
+ return $response->statusCode() . "\n";
+ //print_r($response->headers());
+ //print $response->body() . "\n";
+ } catch (Exception $e) {
+ self::$errLog->puts("{$this->pm->ErrorInfo} (while attempting -- Recipient: $recipient, Subject: $subject)");
+ return 'Caught exception: '. $e->getMessage() ."\n";
+ }
+ }
+}
+?>
diff --git a/lib/Flux/PaymentNotifyRequest.php b/lib/Flux/PaymentNotifyRequest.php
index 0397fbf79..1fbcd5f5a 100644
--- a/lib/Flux/PaymentNotifyRequest.php
+++ b/lib/Flux/PaymentNotifyRequest.php
@@ -323,7 +323,13 @@ public function process()
$this->logPayPal('Transaction invalid, aborting.');
if(!in_array($received_from, $allowed_hosts) && Flux::config('PaypalHackNotify')){
- require_once 'Flux/Mailer.php';
+ if(Flux::config('SendGridAPIKey')){
+ require_once 'Flux/MailerSendGrid.php';
+ $mail = new Flux_Mailer_SendGrid();
+ } else {
+ require_once 'Flux/Mailer.php';
+ $mail = new Flux_Mailer();
+ }
$customArray = @unserialize(base64_decode((string)$this->ipnVariables->get('custom')));
$customArray = $customArray && is_array($customArray) ? $customArray : array();
@@ -331,7 +337,6 @@ public function process()
$accountID = $customData->get('account_id');
$serverName = $customData->get('server_name');
- $mail = new Flux_Mailer();
$tmpl = "
Paypal hack detected!
";
$tmpl .= "Account: ".$accountID."
";
diff --git a/lib/sendgrid-php/.editorconfig b/lib/sendgrid-php/.editorconfig
new file mode 100644
index 000000000..e18928df3
--- /dev/null
+++ b/lib/sendgrid-php/.editorconfig
@@ -0,0 +1,8 @@
+root = true
+
+[*.php]
+indent_style = space
+indent_size = 4
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
diff --git a/lib/sendgrid-php/.env.sample b/lib/sendgrid-php/.env.sample
new file mode 100644
index 000000000..937e999d4
--- /dev/null
+++ b/lib/sendgrid-php/.env.sample
@@ -0,0 +1 @@
+export SENDGRID_API_KEY=''
diff --git a/lib/sendgrid-php/CHANGELOG.md b/lib/sendgrid-php/CHANGELOG.md
new file mode 100644
index 000000000..7bb4c6785
--- /dev/null
+++ b/lib/sendgrid-php/CHANGELOG.md
@@ -0,0 +1,647 @@
+# Change Log
+All notable changes to this project will be documented in this file.
+
+This project adheres to [Semantic Versioning](http://semver.org/).
+
+[2024-04-18] Version 8.1.2
+--------------------------
+**Library - Chore**
+- [PR #1107](https://github.com/sendgrid/sendgrid-php/pull/1107): updating php-http-client version to dynamic. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
+
+
+[2023-12-06] Version 8.1.1
+--------------------------
+**Library - Chore**
+- [PR #1105](https://github.com/sendgrid/sendgrid-php/pull/1105): updated php-http-client version to enable setHost. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
+
+
+[2023-12-01] Version 8.1.0
+--------------------------
+**Library - Feature**
+- [PR #1104](https://github.com/sendgrid/sendgrid-php/pull/1104): Added Data residency for eu and global region. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
+
+
+[2022-08-10] Version 8.0.1
+--------------------------
+**Library - Docs**
+- [PR #1097](https://github.com/sendgrid/sendgrid-php/pull/1097): rewrite function description. Thanks to [@mohamed-foly](https://github.com/mohamed-foly)!
+- [PR #1095](https://github.com/sendgrid/sendgrid-php/pull/1095): Modify README in alignment with SendGrid Support. Thanks to [@garethpaul](https://github.com/garethpaul)!
+
+**Library - Fix**
+- [PR #1081](https://github.com/sendgrid/sendgrid-php/pull/1081): get rid of deprecation warnings regarding the first parameter of mb_convert_encoding. Thanks to [@cclark61](https://github.com/cclark61)!
+
+**Library - Test**
+- [PR #1099](https://github.com/sendgrid/sendgrid-php/pull/1099): Adding misc as PR type. Thanks to [@rakatyal](https://github.com/rakatyal)!
+
+
+[2022-05-04] Version 8.0.0
+--------------------------
+**Note:** This release contains breaking changes, check our [upgrade guide](./UPGRADE.md#2022-05-04-7xx-to-8xx) for detailed migration notes.
+
+**Library - Chore**
+- [PR #1090](https://github.com/sendgrid/sendgrid-php/pull/1090): drop support for EOL PHP versions and add support for PHP 8. Thanks to [@childish-sambino](https://github.com/childish-sambino)! **(breaking change)**
+
+
+[2022-03-09] Version 7.11.5
+---------------------------
+**Library - Chore**
+- [PR #1085](https://github.com/sendgrid/sendgrid-php/pull/1085): push Datadog Release Metric upon deploy success. Thanks to [@eshanholtz](https://github.com/eshanholtz)!
+
+
+[2022-02-09] Version 7.11.4
+---------------------------
+**Library - Chore**
+- [PR #1079](https://github.com/sendgrid/sendgrid-php/pull/1079): add deploy job to test and deploy gh workflow. Thanks to [@Hunga1](https://github.com/Hunga1)!
+
+
+[2022-01-26] Version 7.11.3
+---------------------------
+**Library - Chore**
+- [PR #1075](https://github.com/sendgrid/sendgrid-php/pull/1075): migrate to Github actions. Thanks to [@JenniferMah](https://github.com/JenniferMah)!
+
+
+[2022-01-12] Version 7.11.2
+---------------------------
+**Library - Chore**
+- [PR #1074](https://github.com/sendgrid/sendgrid-php/pull/1074): update license year. Thanks to [@JenniferMah](https://github.com/JenniferMah)!
+
+
+[2021-12-15] Version 7.11.1
+---------------------------
+**Library - Fix**
+- [PR #1066](https://github.com/sendgrid/sendgrid-php/pull/1066): Suppress deprecation warnings in PHP 8.1. Thanks to [@andreas-aeschlimann](https://github.com/andreas-aeschlimann)!
+
+
+[2021-11-17] Version 7.11.0
+---------------------------
+**Library - Feature**
+- [PR #1065](https://github.com/sendgrid/sendgrid-php/pull/1065): add spam, bounce and unsubscribe bypass management filters. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)!
+
+
+[2021-10-18] Version 7.10.0
+---------------------------
+**Library - Feature**
+- [PR #1061](https://github.com/sendgrid/sendgrid-php/pull/1061): allow personalization of the From name and email for each email recipient. Thanks to [@beebzz](https://github.com/beebzz)!
+
+**Library - Docs**
+- [PR #1060](https://github.com/sendgrid/sendgrid-php/pull/1060): improve signed webhook event validation docs. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)!
+
+
+[2021-01-27] Version 7.9.2
+--------------------------
+**Library - Fix**
+- [PR #1030](https://github.com/sendgrid/sendgrid-php/pull/1030): Fixing namespace for classes on test/unit folder. Thanks to [@peter279k](https://github.com/peter279k)!
+
+
+[2020-11-18] Version 7.9.1
+--------------------------
+**Library - Docs**
+- [PR #980](https://github.com/sendgrid/sendgrid-php/pull/980): Incorrect links in Use Cases, section Email Stats. Thanks to [@kampalex](https://github.com/kampalex)!
+
+
+[2020-11-05] Version 7.9.0
+--------------------------
+**Library - Feature**
+- [PR #674](https://github.com/sendgrid/sendgrid-php/pull/674): Allows for a user to utilize self-signed certificates. Thanks to [@davcpas1234](https://github.com/davcpas1234)!
+
+**Library - Test**
+- [PR #704](https://github.com/sendgrid/sendgrid-php/pull/704): Adding php static analysis. Thanks to [@reisraff](https://github.com/reisraff)!
+
+
+[2020-10-14] Version 7.8.5
+--------------------------
+**Library - Docs**
+- [PR #1009](https://github.com/sendgrid/sendgrid-php/pull/1009): Incorrect value order in example array for addAttachments. Thanks to [@Anorris-NLR](https://github.com/Anorris-NLR)!
+
+
+[2020-09-28] Version 7.8.4
+--------------------------
+**Library - Fix**
+- [PR #1006](https://github.com/sendgrid/sendgrid-php/pull/1006): don't wrap names in double-quotes. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
+
+**Library - Chore**
+- [PR #725](https://github.com/sendgrid/sendgrid-php/pull/725): Require conformance to style standards. Thanks to [@jmauerhan](https://github.com/jmauerhan)!
+
+
+[2020-09-02] Version 7.8.3
+--------------------------
+**Library - Fix**
+- [PR #1001](https://github.com/sendgrid/sendgrid-php/pull/1001): support 'to' addresses with subjects. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
+
+
+[2020-08-19] Version 7.8.2
+--------------------------
+**Library - Docs**
+- [PR #717](https://github.com/sendgrid/sendgrid-php/pull/717): Update documentation for retrieving a list of all templates. Thanks to [@renshuki](https://github.com/renshuki)!
+- [PR #729](https://github.com/sendgrid/sendgrid-php/pull/729): Added S3 attachment example. Thanks to [@semijoelon](https://github.com/semijoelon)!
+- [PR #984](https://github.com/sendgrid/sendgrid-php/pull/984): Reduce excessive comments in code examples. Thanks to [@kampalex](https://github.com/kampalex)!
+
+**Library - Test**
+- [PR #735](https://github.com/sendgrid/sendgrid-php/pull/735): add unit tests for lib/email. Thanks to [@peter279k](https://github.com/peter279k)!
+- [PR #756](https://github.com/sendgrid/sendgrid-php/pull/756): Add more scenarios for email address encoding. Thanks to [@2mt-heuser](https://github.com/2mt-heuser)!
+
+**Library - Chore**
+- [PR #993](https://github.com/sendgrid/sendgrid-php/pull/993): update GitHub branch references to use HEAD. Thanks to [@thinkingserious](https://github.com/thinkingserious)!
+
+
+[2020-08-05] Version 7.8.1
+--------------------------
+**Library - Fix**
+- [PR #755](https://github.com/sendgrid/sendgrid-php/pull/755): remove loader.php and update CONTRIBUTING.md. Thanks to [@mkasberg](https://github.com/mkasberg)!
+
+
+[2020-07-22] Version 7.8.0
+--------------------------
+**Library - Chore**
+- [PR #990](https://github.com/sendgrid/sendgrid-php/pull/990): migrate to new default sendgrid-oai branch. Thanks to [@eshanholtz](https://github.com/eshanholtz)!
+
+**Library - Docs**
+- [PR #778](https://github.com/sendgrid/sendgrid-php/pull/778): fix grammar issue in CHANGELOG. Thanks to [@Hestersue43](https://github.com/Hestersue43)!
+- [PR #759](https://github.com/sendgrid/sendgrid-php/pull/759): add Email Activity API to usage docs. Thanks to [@ajloria](https://github.com/ajloria)!
+
+**Library - Feature**
+- [PR #850](https://github.com/sendgrid/sendgrid-php/pull/850): Add an option to override SendGrid Client path version. Thanks to [@erbaker](https://github.com/erbaker)!
+- [PR #762](https://github.com/sendgrid/sendgrid-php/pull/762): enhanced type exception handling. Thanks to [@misantron](https://github.com/misantron)!
+
+
+[2020-07-08] Version 7.7.0
+--------------------------
+**Library - Feature**
+- [PR #985](https://github.com/sendgrid/sendgrid-php/pull/985): Additional check for existence of Composer autoloader. Thanks to [@kampalex](https://github.com/kampalex)!
+- [PR #978](https://github.com/sendgrid/sendgrid-php/pull/978): Mail constructor: Added support for array of Substitution instances using $globalSubstitutions. Thanks to [@kampalex](https://github.com/kampalex)!
+
+**Library - Fix**
+- [PR #976](https://github.com/sendgrid/sendgrid-php/pull/976): allow a float type as a substitution value in transactional templates. Thanks to [@thinkingserious](https://github.com/thinkingserious)!
+- [PR #977](https://github.com/sendgrid/sendgrid-php/pull/977): Mail constructor: Verify arguments $plainTextContent and $htmlContent if provided. Thanks to [@kampalex](https://github.com/kampalex)!
+- [PR #971](https://github.com/sendgrid/sendgrid-php/pull/971): Optional Personalization arguments handling. Thanks to [@kampalex](https://github.com/kampalex)!
+
+
+[2020-06-10] Version 7.6.0
+--------------------------
+**Library - Fix**
+- [PR #975](https://github.com/sendgrid/sendgrid-php/pull/975): Inspected code of Stats, example helpers. Thanks to [@kampalex](https://github.com/kampalex)!
+- [PR #967](https://github.com/sendgrid/sendgrid-php/pull/967): add support for unicode in local part of email address when using PHP>=7.1. Thanks to [@kampalex](https://github.com/kampalex)!
+- [PR #974](https://github.com/sendgrid/sendgrid-php/pull/974): Accept string typed Subject in Personalization. Thanks to [@kampalex](https://github.com/kampalex)!
+- [PR #973](https://github.com/sendgrid/sendgrid-php/pull/973): Replace dynamic template data typehints. Thanks to [@kampalex](https://github.com/kampalex)!
+
+**Library - Feature**
+- [PR #969](https://github.com/sendgrid/sendgrid-php/pull/969): verify signature from event webhook. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
+
+
+[2020-05-27] Version 7.5.2
+--------------------------
+**Library - Fix**
+- [PR #966](https://github.com/sendgrid/sendgrid-php/pull/966): Rename 'BaseInterface' to 'BaseSendGridClientInterface.php'. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
+- [PR #965](https://github.com/sendgrid/sendgrid-php/pull/965): use classmap instead of files for Composer autoload. Thanks to [@kampalex](https://github.com/kampalex)!
+
+**Library - Docs**
+- [PR #839](https://github.com/sendgrid/sendgrid-php/pull/839): add documentation for segments in USAGE.md. Thanks to [@rwhirn](https://github.com/rwhirn)!
+
+
+[2020-05-13] Version 7.5.1
+--------------------------
+**Library - Fix**
+- [PR #960](https://github.com/sendgrid/sendgrid-php/pull/960): migrate to common prism setup. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
+
+
+[2020-04-29] Version 7.5.0
+--------------------------
+**Library - Fix**
+- [PR #952](https://github.com/sendgrid/sendgrid-php/pull/952): refactor and fix personalization inserts/updates. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
+
+**Library - Feature**
+- [PR #951](https://github.com/sendgrid/sendgrid-php/pull/951): add support for Twilio Email. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
+
+
+[2020-04-01] Version 7.4.6
+--------------------------
+**Library - Docs**
+- [PR #947](https://github.com/sendgrid/sendgrid-php/pull/947): support verbiage for login issues. Thanks to [@adamchasetaylor](https://github.com/adamchasetaylor)!
+- [PR #946](https://github.com/sendgrid/sendgrid-php/pull/946): correct params order in example.php. Thanks to [@spaze](https://github.com/spaze)!
+
+
+[2020-03-18] Version 7.4.5
+--------------------------
+**Library - Docs**
+- [PR #749](https://github.com/sendgrid/sendgrid-php/pull/749): add @throws to docblock. Thanks to [@iPoul](https://github.com/iPoul)!
+
+
+[2020-03-04] Version 7.4.4
+--------------------------
+**Library - Chore**
+- [PR #941](https://github.com/sendgrid/sendgrid-php/pull/941): add PHP 7.4 to Travis and test with lowest dependencies. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
+
+
+[2020-02-19] Version 7.4.3
+--------------------------
+**Library - Fix**
+- [PR #918](https://github.com/sendgrid/sendgrid-php/pull/918): resolve deprecation notices when using Composer 1.10(-dev). Thanks to [@kampalex](https://github.com/kampalex)!
+- [PR #939](https://github.com/sendgrid/sendgrid-php/pull/939): drop the prism binary and ignore unneeded files from the archive. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
+
+
+[2020-01-22] Version 7.4.2
+--------------------------
+**Library - Docs**
+- [PR #928](https://github.com/sendgrid/sendgrid-php/pull/928): baseline all the templated markdown docs. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
+
+
+[2020-01-09] Version 7.4.1
+--------------------------
+**Library - Docs**
+- [PR #710](https://github.com/sendgrid/sendgrid-php/pull/710): correct the *.md files using Grammarly. Thanks to [@myzeprog](https://github.com/myzeprog)!
+- [PR #742](https://github.com/sendgrid/sendgrid-php/pull/742): properly capitalize brands GitHub and SendGrid. Thanks to [@aslafy-z](https://github.com/aslafy-z)!
+- [PR #737](https://github.com/sendgrid/sendgrid-php/pull/737): remove `sudo` requirement for running docker. Thanks to [@jamietanna](https://github.com/jamietanna)!
+
+**Library - Chore**
+- [PR #926](https://github.com/sendgrid/sendgrid-php/pull/926): prep the repo for automated releasing. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
+
+**Library - Fix**
+- [PR #765](https://github.com/sendgrid/sendgrid-php/pull/765): correct typo in PR template from "Sendgrid" to "SendGrid". Thanks to [@JoeRomeo](https://github.com/JoeRomeo)!
+- [PR #757](https://github.com/sendgrid/sendgrid-php/pull/757): remove dead code when setting the subject. Thanks to [@2mt-heuser](https://github.com/2mt-heuser)!
+- [PR #761](https://github.com/sendgrid/sendgrid-php/pull/761): correct the License file path in ReadMe. Thanks to [@sanjaysingh](https://github.com/sanjaysingh)!
+- [PR #770](https://github.com/sendgrid/sendgrid-php/pull/770): update the link for cURL example in Troubleshooting.MD. Thanks to [@music-mind](https://github.com/music-mind)!
+- [PR #887](https://github.com/sendgrid/sendgrid-php/pull/887): correct the mail helper readme link in example. Thanks to [@flashadvocate](https://github.com/flashadvocate)!
+
+
+[2019-12-11] Version 7.4.0
+--------------------------
+
+**Library - Fix**
+- [PR #705](https://github.com/sendgrid/sendgrid-php/pull/705): Fixing issue #686: NULL Item in Personalizations. Thanks to [@reisraff](https://github.com/reisraff)!
+- [PR #788](https://github.com/sendgrid/sendgrid-php/pull/788): Fixes #788 - Add missing parameter for addCc and addBcc methods. Thanks to [@hjmsw](https://github.com/hjmsw)!
+
+**Library - Docs**
+- [PR #836](https://github.com/sendgrid/sendgrid-php/pull/836): Update example.php. Add personalization example as per #792. Thanks to [@hjmsw](https://github.com/hjmsw)!
+
+**Library - Feature**
+- [PR #841](https://github.com/sendgrid/sendgrid-php/pull/841): Make $emailAddress on TypeException to be evaluated. Thanks to [@yehudah](https://github.com/yehudah)!
+
+## [7.3.0] - 2019-04-15 ##
+### Fixed
+- PR [#821](https://github.com/sendgrid/sendgrid-php/pull/821): PHP 7.3 support and fix Prism download problem.
+- Closes [#669](https://github.com/sendgrid/sendgrid-php/issues/669), PR [#670](https://github.com/sendgrid/sendgrid-php/pull/670): Fix Mail::setGlobalSubject(). Thanks to [Spencer Salisbury](https://github.com/smsalisbury) for the solution!
+- Closes [#782](https://github.com/sendgrid/sendgrid-php/issues/782), PR [#783](https://github.com/sendgrid/sendgrid-php/pull/783): Remove references to 'whitelabel'. Thanks to [Chandler Weiner](https://github.com/crweiner) for the solution!
+- Closes [#763](https://github.com/sendgrid/sendgrid-php/issues/763), PR [#764](https://github.com/sendgrid/sendgrid-php/pull/764): Update link to license. Thanks to [Pranjal Vyas](https://github.com/vyaspranjal33) for the solution!
+- PR [#760](https://github.com/sendgrid/sendgrid-php/pull/760): Clean up Prism shell script. Thanks to [gy741](https://github.com/gy741) for the solution!
+- Closes [#739](https://github.com/sendgrid/sendgrid-php/issues/739), PR [#740](https://github.com/sendgrid/sendgrid-php/pull/740): . Thanks to [Alex Borisov](https://github.com/smrtab) for the solution!
+
+### Added
+- PR [#828](https://github.com/sendgrid/sendgrid-php/pull/828): Update Twilio branding, CLA policy.
+- Closes [#768](https://github.com/sendgrid/sendgrid-php/issues/768), PR [#769](https://github.com/sendgrid/sendgrid-php/pull/769): Update prerequisites. Thanks to [Rishabh](https://github.com/Rishabh04-02) for the solution!
+- Closes [#733](https://github.com/sendgrid/sendgrid-php/issues/733), PR [#736](https://github.com/sendgrid/sendgrid-php/pull/736): Update CONTRIBUTING - contribution guideline to branch off development. Thanks to [Alex](https://github.com/myzeprog) for the solution!
+- Closes [#481](https://github.com/sendgrid/sendgrid-php/issues/481), PR [#743](https://github.com/sendgrid/sendgrid-php/pull/743): Added Box attachment example. Thanks to [Joel](https://github.com/semijoelon) for the solution!
+- Closes [#690](https://github.com/sendgrid/sendgrid-php/issues/690), PR [#698](https://github.com/sendgrid/sendgrid-php/pull/698): Update prism version. Thanks to [Gergo Juhasz](https://github.com/geryjuhasz) for the solution!
+
+## [7.2.1] - 2018-09-18 ##
+### Fixed
+- Closes [#671](https://github.com/sendgrid/sendgrid-php/issues/671), PR [#689](https://github.com/sendgrid/sendgrid-php/pull/689): isBase64 function returning incorrect. Thanks to [Jmky](https://github.com/Jmky) for the solution!
+
+## [7.2.0] - 2018-08-15 ##
+### Added
+- Closes [#648](https://github.com/sendgrid/sendgrid-php/issues/648), PR [#657](https://github.com/sendgrid/sendgrid-php/pull/657): Allow for Dynamic Templates Implementation. Thanks to [Mike Willbanks](https://github.com/mwillbanks) for the PR!
+
+## [7.1.1] - 2018-08-15 ##
+### Fixed
+- Closes [#667](https://github.com/sendgrid/sendgrid-php/issues/667), PR [#668](https://github.com/sendgrid/sendgrid-php/pull/668): isBase64 function fix. Thanks to [Tigran M](https://github.com/developer-devPHP) for bringing this to our attention!
+
+## [7.1.0] - 2018-08-14 ##
+### Added
+
+- Closes [#612](https://github.com/sendgrid/sendgrid-php/issues/612), PR [#652](https://github.com/sendgrid/sendgrid-php/pull/652): Fixes #612 Add TypeException and include type validations in classes inside mail/. Thanks to [James Harding](https://github.com/hjmsw) for the PR!
+- Closes [#551](https://github.com/sendgrid/sendgrid-php/issues/551), PR [#571](https://github.com/sendgrid/sendgrid-php/pull/571): Add ability to impersonate subuser. Thanks to [Stian Prestholdt](https://github.com/stianpr) for the PR!
+- Closes [#617](https://github.com/sendgrid/sendgrid-php/issues/617), PR [#651](https://github.com/sendgrid/sendgrid-php/pull/651): Add try / catch to examples. Thanks to [James Harding](https://github.com/hjmsw) for the PR!
+- Closes [#619](https://github.com/sendgrid/sendgrid-php/issues/619), PR [#620](https://github.com/sendgrid/sendgrid-php/pull/620): PHPDoc & code improvements. Thanks to [Martijn Melchers](https://github.com/martijnmelchers) for the PR!
+- Closes [#610](https://github.com/sendgrid/sendgrid-php/issues/610), PR [#628](https://github.com/sendgrid/sendgrid-php/pull/628): Removes unnecessary linter warning from phpcs. Thanks to [James Harding](https://github.com/hjmsw) for the PR!
+- Closes [#608](https://github.com/sendgrid/sendgrid-php/issues/611), PR [#626](https://github.com/sendgrid/sendgrid-php/pull/626): Add check so that getContents() always returns content with MimeType text/plain first in array of Content objects. Thanks to [James Harding](https://github.com/hjmsw) for the PR!
+- Closes [#611](https://github.com/sendgrid/sendgrid-php/issues/611), PR [#618](https://github.com/sendgrid/sendgrid-php/pull/618): Attachments now automatically get base64 encoded if they are not already. Thanks to [Martijn Melchers](https://github.com/martijnmelchers) for the PR!
+- PR [#661](https://github.com/sendgrid/sendgrid-php/pull/661): Add Code Triage tag. Thanks to [Anshul Singhal](https://github.com/af4ro) for the PR!
+- PR [#663](https://github.com/sendgrid/sendgrid-php/pull/663): Improve Contributing.md readability. Thanks to [Anshul Singhal](https://github.com/af4ro) for the PR!
+
+### Fixed
+- PR [#631](https://github.com/sendgrid/sendgrid-php/pull/631): Broken documentation link. Thanks to [David Duman](https://github.com/dvdnhm) for the PR!
+- PR [#633](https://github.com/sendgrid/sendgrid-php/pull/633): Fixes for non-composer environments. Thanks to [Tom Gordon](https://github.com/apcro) for the PR!
+- PR [#634](https://github.com/sendgrid/sendgrid-php/pull/634): Fixes missing file extension. Thanks to [Muberra Duman Demirtepe](https://github.com/muberraduman) for the PR!
+- PR [#658](https://github.com/sendgrid/sendgrid-php/pull/658): Corrected PHP Syntax. Thanks to [David Passmore](https://github.com/davcpas1234) for the PR!
+- Fixes [#624](https://github.com/sendgrid/sendgrid-php/issues/624), PR [#625](https://github.com/sendgrid/sendgrid-php/pull/625): Fix setGroupsToDisplay's handling of array arguments. Thanks to [Mo Ismailzai](https://github.com/moismailzai) for the PR!
+
+## [7.0.0] - 2018-05-19 ##
+### BREAKING CHANGE
+
+Thanks to the [strong support and feedback of the SendGrid PHP community](https://github.com/sendgrid/sendgrid-php/issues/434), we have a new version of this SDK that should be a big improvement in the developer experience for this SDK.
+
+In particular, I'd like to make special mention of [@caseyw](https://github.com/caseyw), [@vitya1](https://github.com/vitya1), [@Braunson](https://github.com/Braunson), [@cbschuld](https://github.com/cbschuld), [@paoga87](https://github.com/paoga87), [@Taluu](https://github.com/Taluu), [@mazanax](https://github.com/mazanax), [@ninsuo](https://github.com/ninsuo), [@ianh2](https://github.com/ianh2), [@WadeShuler](https://github.com/WadeShuler), [@jaimehing](https://github.com/jaimehing), [@KnightAR](https://github.com/KnightAR), [@alextech](https://github.com/alextech) (my apologies if I've missed you)
+
+Since this is a major departure from v6.X, we advise you to refactor your code according to the documentation found in the [README](README.md) and [USE_CASES](USE_CASES.md) files. We hope you find the new interface much easier to work with. Please open an [issue](https://github.com/sendgrid/sendgrid-php/issues) or PR if you run into any trouble or have any feedback.
+
+If you wish to continue using previous versions of this SDK, no problem. However, we will not be updating versions less than v7 except for critical bugs and/or security issues.
+
+We hope this will be the last breaking change in the foreseeable future; that said, let the iterations begin!
+
+## [6.2.0] - 2018-03-28 ##
+### Added
+- Closes [#454](https://github.com/sendgrid/sendgrid-php/issues/454), PR [#502](https://github.com/sendgrid/sendgrid-php/pull/502):
+Add helper for adding new recipients to your contactdb via a webform, thanks to [Kraig Hufstedler](https://github.com/kraigh) for the PR!
+
+- Closes [#487](https://github.com/sendgrid/sendgrid-php/issues/487), PR [#506](https://github.com/sendgrid/sendgrid-php/pull/506):
+Add helper to get all stats from a specified data range, thanks to [Milos Pejanovic](https://github.com/runz0rd) for the PR!
+
+- Closes [#368](https://github.com/sendgrid/sendgrid-php/issues/368), PR [#511](https://github.com/sendgrid/sendgrid-php/pull/511):
+Add support for commas and semicolns in email name, thanks to [Quentin Ligier](https://github.com/qligier) for the PR!
+
+- Closes [#491](https://github.com/sendgrid/sendgrid-php/issues/491), PR [#493](https://github.com/sendgrid/sendgrid-php/pull/493:
+Allow for setting attachment content from path, thanks to [rparpa](https://github.com/rparpa) for the PR!
+
+## [6.1.0] - 2018-03-27 ##
+### Added
+- PR [#512](https://github.com/sendgrid/sendgrid-php/pull/512): Omit PHP closing tag in use case sample, thanks to [Sébastien Santoro](https://github.com/dereckson) for the PR!
+
+- PR [#575](https://github.com/sendgrid/sendgrid-php/pull/575): Add an example to the README.md describing how to send emails as HTML as the content type, thanks to [Benjamin Manford](https://github.com/manfordbenjamin) for the PR!
+
+- Closes [#547](https://github.com/sendgrid/sendgrid-php/issues/547), PR [#549](https://github.com/sendgrid/sendgrid-php/pull/549):
+Added Code Review to Contributing.md, thanks to [tomhorvat](https://github.com/tomhorvat) for the PR!
+
+- PR [#565](https://github.com/sendgrid/sendgrid-php/pull/565): Add PHP 7.1 and 7.2 to Travis build matrix, thanks to [Emir Beganović](https://github.com/emirb) for the PR!
+
+- PR [#577](https://github.com/sendgrid/sendgrid-php/pull/577): Update PHP Version terms, thanks to [Siddhant Sharma](https://github.com/ssiddhantsharma) for the PR!
+
+- Closes [#540](https://github.com/sendgrid/sendgrid-php/issues/540), PR [#543](https://github.com/sendgrid/sendgrid-php/pull/543):
+Feature/split unit tests, thanks to [Owen Voke](https://github.com/pxgamer) for the PR!
+
+- Closes [#441](https://github.com/sendgrid/sendgrid-php/issues/441), PR [#467](https://github.com/sendgrid/sendgrid-php/pull/467):
+Add deploy to heroku button, thanks to [pangaunn](https://github.com/pangaunn) for the PR!
+
+- Closes [#423](https://github.com/sendgrid/sendgrid-php/issues/423), PR [#510](https://github.com/sendgrid/sendgrid-php/pull/510):
+Adding Google App engine installation with composer instructions, thanks to [Nalin Bhardwaj](https://github.com/nalinbhardwaj) for the PR!
+
+- Closes [#541](https://github.com/sendgrid/sendgrid-php/issues/541), PR [#542](https://github.com/sendgrid/sendgrid-php/pull/542):
+Added CodeCov support, thanks to [Owen Voke](https://github.com/pxgamer) for the PR!
+
+- PR [#539](https://github.com/sendgrid/sendgrid-php/pull/539): Rename LICENSE.txt to md, thanks to [Ankit Jain](https://github.com/ankitjain28may) for the PR!
+
+- Closes [#436](https://github.com/sendgrid/sendgrid-php/issues/436), PR [#535](https://github.com/sendgrid/sendgrid-php/pull/535): Add docker development setup, thanks to [Samundra Shrestha](https://github.com/samundra) for the PR!
+
+- Closes [#532](https://github.com/sendgrid/sendgrid-php/issues/532), PR [#537](https://github.com/sendgrid/sendgrid-php/pull/537): Add license date range unit test, thanks to [uppe-r](https://github.com/uppe-r) for the PR!
+
+- Closes [#533](https://github.com/sendgrid/sendgrid-php/issues/533), PR [#536](https://github.com/sendgrid/sendgrid-php/pull/536): Add unit test to check that specific files exist in repo, thanks to [Bertus Steenberg](https://github.com/bertuss) for the PR!
+
+- Closes [#524](https://github.com/sendgrid/sendgrid-php/issues/524), PR [#527](https://github.com/sendgrid/sendgrid-php/pull/527): Created code climate YML file, thanks to [Prashu Chaudhary](https://github.com/prashuchaudhary) for the PR!
+
+- Closes [#520](https://github.com/sendgrid/sendgrid-php/issues/520), PR [#523](https://github.com/sendgrid/sendgrid-php/pull/523): Added sample env file, thanks to [Joey Lee](https://github.com/yeoji) for the PR!
+
+- PR [#519](https://github.com/sendgrid/sendgrid-php/pull/519): Add github PR template, thanks to [Alex](https://github.com/pushkyn) for the PR!
+
+- PR [#513](https://github.com/sendgrid/sendgrid-php/pull/513): Update to PHP 7.0.0 refactor - Fix syntax error in refactor documentation, thanks to [Sébastien Santoro](https://github.com/dereckson) for the PR!
+
+- PR [#505](https://github.com/sendgrid/sendgrid-php/pull/505): Update README.md with additional badges, thanks to [Lalit Vijay](https://github.com/lalitvj) for the PR!
+
+- Closes [#500](https://github.com/sendgrid/sendgrid-php/issues/500), PR [#504](https://github.com/sendgrid/sendgrid-php/pull/504): SEO Friendly Section links, thanks to [Dharma Saputra](https://github.com/ladhadha) for the PR!
+
+- PR [#503](https://github.com/sendgrid/sendgrid-php/pull/503): Added new badges to README.md, thanks to [Alex](https://github.com/myzeprog) for the PR!
+
+- Closes [#492](https://github.com/sendgrid/sendgrid-php/issues/492), PR [#494](https://github.com/sendgrid/sendgrid-php/pull/494): Demonstrate how to review the request body for troubleshooting, thanks to [Alex](https://github.com/myzeprog) for the PR!
+
+- PR [#476](https://github.com/sendgrid/sendgrid-php/pull/476): Update README.md with license information, thanks to [Tarmo Leppänen](https://github.com/tarlepp) for the PR!
+
+- PR [#475](https://github.com/sendgrid/sendgrid-php/pull/475): Add documentation for setting up domain whitelabel, thanks to [Sourav Sarkar](https://github.com/amsourav) for the PR!
+
+- PR [#468](https://github.com/sendgrid/sendgrid-php/pull/463): Changes the recommendation to use composer as recommended source, thanks to [Gabriela D'Ávila Ferrara](https://github.com/gabidavila) for the PR!
+
+- PR [#463](https://github.com/sendgrid/sendgrid-php/pull/463): Add TROUBLESHOOTING.md section about fixing error 415, thanks to [AlbinoDrought](https://github.com/AlbinoDrought) for the PR!
+
+- PR [#456](https://github.com/sendgrid/sendgrid-php/pull/456): Added Code of Conduct, thanks to [Rubemlrm](https://github.com/Rubemlrm) for the PR!
+
+- PR [#439](https://github.com/sendgrid/sendgrid-php/pull/439): Update to PHP 7.0.0 refactor - Removal of Collections, thanks to [Joseph Opanel](https://github.com/jopanel) for the PR!
+
+- PR [#416](https://github.com/sendgrid/sendgrid-php/pull/416): Add release notifications, thanks to [Gabriel Krell](https://github.com/gabrielkrell) for the PR!
+
+- PR [#415](https://github.com/sendgrid/sendgrid-php/pull/415): Updated example.php to fix that there was no way for the sections to get substituted without their being a substitution that calls them, thanks to [Kyle Roberts](https://github.com/kylearoberts) for the PR!
+
+### Fixed
+- PR [#545](https://github.com/sendgrid/sendgrid-php/pull/545): Fix typo CONTRIBUTING.md, thanks to [thepriefy](https://github.com/thepriefy) for the PR!
+
+- PR [#588](https://github.com/sendgrid/sendgrid-php/pull/588): Fix broken unit tests
+
+- PR [#576](https://github.com/sendgrid/sendgrid-php/pull/576): API level addressing of the string-only in addSubstitution arg rule. Every long integer triggers a bad request, thanks to [Ezequiel Villarreal](https://github.com/saruman) for the PR!
+
+- PR [#517](https://github.com/sendgrid/sendgrid-php/pull/517): Fix typos in USAGE.md, thanks to [Anatoly](https://github.com/anatolyyyyyy) for the PR!
+
+- PR [#530](https://github.com/sendgrid/sendgrid-php/pull/530): Changed the license period., thanks to [Siddhant Sharma](https://github.com/ssiddhantsharma) for the PR!
+
+- PR [#514](https://github.com/sendgrid/sendgrid-php/pull/514): Don't close img tag in HTML, thanks to [Sébastien Santoro](https://github.com/dereckson) for the PR!
+
+- PR [#507](https://github.com/sendgrid/sendgrid-php/pull/507): Fix typos in various files, thanks to [Brandon Smith](https://github.com/brandon93s) for the PR!
+
+- Fixes [#336](https://github.com/sendgrid/sendgrid-php/issues/336), PR [#479](https://github.com/sendgrid/sendgrid-php/pull/479): Incorrect documentation path fixed, thanks to [Valerian Pereira](https://github.com/valerianpereira) for the PR!
+
+- PR [#465](https://github.com/sendgrid/sendgrid-php/pull/465): Fix typo in README.md, thanks to [shra1cumar](https://github.com/shra1cumar) for the PR!
+
+- PR [#449](https://github.com/sendgrid/sendgrid-php/pull/449): Fix typos in USAGE.md, thanks to [Cícero Pablo](https://github.com/ciceropablo) for the PR!
+
+- PR [#448](https://github.com/sendgrid/sendgrid-php/pull/448): Fix typos in TROUBLESHOOTING.md, thanks to [Cícero Pablo](https://github.com/ciceropablo) for the PR!
+
+- PR [#435](https://github.com/sendgrid/sendgrid-php/pull/435): Change spam_report() to spam_reports() in documentation and examples, thanks to [mrmxs](https://github.com/mrmxs) for the PR!
+
+- PR [#431](https://github.com/sendgrid/sendgrid-php/pull/431): Fixed minor typo during Mail creation, thanks to [joeldixon66](https://github.com/joeldixon66) for the PR!
+
+## [6.0.0] - 2017-06-30 ##
+### BREAKING CHANGE
+- PR #408: Update Mail constructor to signify which parameters are required for sending all email
+- The `Mail()` constructor now requires `$from`, `$subject`, `$to` and `$content` parameters like so: `Mail($from, $subject, $to, $content)`. Those are the minimally required parameters to send an email.
+- Thanks to [Casey Wilson](https://github.com/caseyw) for the PR!
+
+## [5.6.2] - 2017-06-29 ##
+### Fix
+- PR #410: Adding name for ReplyTo for issue #390
+- Thanks to [Casey Wilson](https://github.com/caseyw) for the PR!
+
+## [5.6.1] - 2017-06-26 ##
+### Fix
+- Versioning mistake (forgot the .0 at the end)
+
+## [5.6.0] - 2017-06-26 ##
+### Added
+- Pull #405: Updating docs and non-composer includes
+- Thanks to [Casey Wilson](https://github.com/caseyw) for the PR!
+
+## [5.5.1] - 2017-05-18 ##
+### Fixed
+- Pull #396: Use `print_r` instead of `echo` on Arrays
+- Thanks to [Ryan P.C. McQuen](https://github.com/ryanpcmcquen) for the PR!
+
+## [5.5.0] - 2017-05-04 ##
+### Added
+- Pull #393: Update [php-http-client](https://github.com/sendgrid/php-http-client) dependency
+- [v3.6](https://github.com/sendgrid/php-http-client/releases/tag/v3.6.0): Pass the curlOptions to the client in buildClient
+- [v3.7](https://github.com/sendgrid/php-http-client/releases/tag/v3.7.0): Added ability to get headers as associative array
+
+## [5.4.2] - 2017-04-18 ##
+### Fixes
+- Fixes #292
+- Removes Prism file in sendgrid-php.zip
+
+## [5.4.1] - 2017-04-04 ##
+### Added
+- Pull #373
+- PSR1 & PSR2 Conversion
+- Thanks to [Braunson Yager](https://github.com/Braunson) for the PR!
+
+## [5.4.0] - 2017-03-16 ##
+### Added
+- Pull #337
+- API level addressing of the string-only custom arg rule
+- Thanks to [Chris Schuld](https://github.com/cbschuld) for the PR!
+
+## [5.3.0] - 2017-03-15 ##
+### Added
+- Pull #367
+- UTF8 encoding forced for content value and message subject
+- Thanks to [Chris Schuld](https://github.com/cbschuld) for the PR!
+
+## [5.2.3] - 2017-03-03 ##
+### Fixed
+- Pull #334
+- Fixed serialization of empty JSON objects, fixes #332 & #314
+- Thanks to [Matthew Dreyer](https://github.com/Dreyer) for the PR!
+
+## [5.2.2] - 2017-03-03 ##
+### Fixed
+- Pull #323
+- Typo 'user' for 'usr'
+- Thanks to [Mike Ralphson](https://github.com/MikeRalphson) for the PR!
+
+## [5.2.1] - 2017-03-01 ##
+### Fixed
+- Pull #353
+- Fixed Issue #352
+- Relative path fix for background jobs
+- Thanks to [Tarcísio Zotelli Ferraz](https://github.com/tarcisiozf) for the PR!
+
+## [5.2.0] - 2017-02-23 ##
+### Added
+- Pull #346
+- Allow passing curlOptions to the client
+- Thanks to [Taluu](https://github.com/sendgrid/sendgrid-php/pull/346) for the PR!
+
+## [5.1.2] - 2016-10-11 ##
+### Added
+- Pull #330, Fixes #320
+- Delete subaccounts returns 200 issue resolved
+- The fix happened at the [php-http-client](https://github.com/sendgrid/php-http-client/releases/tag/v3.5.1) dependency.
+- Thanks to [emil](https://github.com/emilva) for the PR!
+
+## [5.1.1] - 2016-10-11 ##
+### Added
+- Pull #307, Fixes #276
+- Adds phpdoc and style fixes
+- Thanks to [Avishkar Autar](https://github.com/aautar) for the PR!
+
+## [5.1.0] - 2016-09-29 ##
+### Fixed
+- Pull #295: [Upgrade sendgrid/php-http-client](https://github.com/sendgrid/sendgrid-php/pull/295/files)
+- This adds getters for certain properties, please see [this pull request](https://github.com/sendgrid/php-http-client/pull/9) for details
+- Thanks to [Arjan Keeman](https://github.com/akeeman) for the pull request!
+
+## [5.0.9] - 2016-09-13 ##
+### Fixed
+- Pull request #289: [Replace "\jsonSerializable" with "\JsonSerializable" ](https://github.com/sendgrid/sendgrid-php/pull/289)
+- Thanks to [Issei.M](https://github.com/issei-m) for the pull request!
+
+## [5.0.8] - 2016-08-24 ##
+### Added
+- Table of Contents in the README
+- Added a [USE_CASES.md](USE_CASES.md) section, with the first use case example for transactional templates
+
+## [5.0.7] - 2016-07-25 ##
+### Added
+- [Troubleshooting](TROUBLESHOOTING.md) section
+
+## [5.0.6] - 2016-07-20 ##
+### Added
+- README updates
+- Update introduction blurb to include information regarding our forward path
+- Update the v3 /mail/send example to include non-helper usage
+- Update the generic v3 example to include non-fluent interface usage
+
+## [5.0.5] - 2016-07-12 ##
+### Added
+- Update docs, unit tests and examples to include Sender ID
+
+## [5.0.4] - 2016-07-07 ##
+### Added
+- Tests now mocked automatically against [prism](https://stoplight.io/prism/)
+
+## [5.0.3] - 2016-07-05 ##
+### Updated
+- Content based on our updated [Swagger/OAI doc](https://github.com/sendgrid/sendgrid-oai)
+
+## [5.0.2] - 2016-07-05 ##
+### Added
+- Accept: application/json header per https://sendgrid.com/docs/API_Reference/Web_API_v3/How_To_Use_The_Web_API_v3/requests.html
+
+### Updated
+- Content based on our updated [Swagger/OAI doc](https://github.com/sendgrid/sendgrid-oai)
+
+## [5.0.1] - 2016-06-17 ##
+### Fixed
+- Issue with packaged version for non-composer uses
+
+## [5.0.0] - 2016-06-13 ##
+### Added
+- Breaking change to support the v3 Web API
+- New HTTP client
+- v3 Mail Send helper
+
+## [v4.0.4] - (2016-02-18) ##
+### Added
+- Ability to add scopes to API Keys endpoint [POST]
+
+## [v4.0.3] - (2016-02-18) ##
+### Added
+- API Keys endpoint [PUT]
+
+## [v4.0.2] - (2015-12-15) ##
+### Added
+- Tests for API Keys endpoint [POST, PATCH, DELETE]
+
+## [v4.0.1] - (2015-12-03) ##
+### Fixed
+- HTTP 406 Not Acceptable Errors [#177](https://github.com/sendgrid/sendgrid-php/issues/177)
+
+## [v4.0.0] - (2015-10-16) ##
+### Added
+- Added support for accessing the [SendGrid Web API v3 endpoints](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html)
+- Implemented part of the /api_keys, /groups and /suppressions endpoints
+
+## [v3.2.0] - (2015-05-13) ##
+
+### Added
+- Specify Guzzle proxy via [#149](https://github.com/sendgrid/sendgrid-php/pull/149)
+- Option to disable exception raising
+
+## [v3.1.0] - (2015-04-27)
+### Added
+- Support for API keys
+
+## [v3.0.0] - (2015-04-14)
+### Fixed
+- CC and BCC not working with SMTPAPI To
+
+### Changed
+- **Breaking:** A `\SendGrid\Exception` is now raised when response is not 200
+- **Breaking:** `addTo` now uses the Web API parameter as opposed to the SMTPAPI Header. Substitutions will most likely break unless you update to use `addSmtpapiTo`
+- The library now depends on Guzzle3
+- Major refactoring
+
+### Added
+- **Breaking:** `send()` now returns an instance of `\SendGrid\Response`
+- Numerous missing methods for new functionality
+- `addSmtpapiTo` for using the SMTPAPI To
+
+## [v2.2.1] - (2014-01-29)
+### Fixed
+- Fix turn_off_ssl_verification option via [#123](https://github.com/sendgrid/sendgrid-php/pull/123)
+
+## [v2.2.0] - (2014-01-12)
+### Changed
+- Remove [Unirest](https://github.com/Mashape/unirest-php/) and replace with native cURL
+- Add CHANGELOG.md
diff --git a/lib/sendgrid-php/CODE_OF_CONDUCT.md b/lib/sendgrid-php/CODE_OF_CONDUCT.md
new file mode 100644
index 000000000..2f0727ed5
--- /dev/null
+++ b/lib/sendgrid-php/CODE_OF_CONDUCT.md
@@ -0,0 +1,73 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as
+contributors and maintainers pledge to making participation in our project and
+our community a harassment-free experience for everyone, regardless of age, body
+size, disability, ethnicity, sex characteristics, gender identity and expression,
+level of experience, education, socio-economic status, nationality, personal
+appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment
+include:
+
+- Using welcoming and inclusive language
+- Being respectful of differing viewpoints and experiences
+- Gracefully accepting constructive criticism
+- Focusing on what is best for the community
+- Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+- The use of sexualized language or imagery and unwelcome sexual attention or
+ advances
+- Trolling, insulting/derogatory comments, and personal or political attacks
+- Public or private harassment
+- Publishing others' private information, such as a physical or electronic
+ address, without explicit permission
+- Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable
+behavior and are expected to take appropriate and fair corrective action in
+response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or
+reject comments, commits, code, wiki edits, issues, and other contributions
+that are not aligned to this Code of Conduct, or to ban temporarily or
+permanently any contributor for other behaviors that they deem inappropriate,
+threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces
+when an individual is representing the project or its community. Examples of
+representing a project or community include using an official project e-mail
+address, posting via an official social media account, or acting as an appointed
+representative at an online or offline event. Representation of a project may be
+further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported by contacting the project team at open-source@twilio.com. All
+complaints will be reviewed and investigated and will result in a response that
+is deemed necessary and appropriate to the circumstances. The project team is
+obligated to maintain confidentiality with regard to the reporter of an incident.
+Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good
+faith may face temporary or permanent repercussions as determined by other
+members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
+available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
+
+[homepage]: https://www.contributor-covenant.org
diff --git a/lib/sendgrid-php/CONTRIBUTING.md b/lib/sendgrid-php/CONTRIBUTING.md
new file mode 100644
index 000000000..37d2cb7c0
--- /dev/null
+++ b/lib/sendgrid-php/CONTRIBUTING.md
@@ -0,0 +1,160 @@
+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.
+
+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.
+
+- [Improvements to the Codebase](#improvements-to-the-codebase)
+ - [Development Environment](#development-environment)
+ - [Install and Run Locally](#install-and-run-locally)
+ - [Prerequisites](#prerequisites)
+ - [Initial setup:](#initial-setup)
+ - [Environment Variables](#environment-variables)
+ - [Execute:](#execute)
+- [Understanding the Code Base](#understanding-the-codebase)
+- [Testing](#testing)
+- [Style Guidelines & Naming Conventions](#style-guidelines--naming-conventions)
+- [Creating a Pull Request](#creating-a-pull-request)
+- [Code Reviews](#code-reviews)
+
+There are a few ways to contribute, which we'll enumerate below:
+
+## Improvements to the Codebase
+
+We welcome direct contributions to the sendgrid-php code base. Thank you!
+
+Please note that we utilize the [Gitflow Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) for Git to help keep project development organized and consistent.
+
+### Development Environment ###
+
+#### Install and Run Locally ####
+
+##### Prerequisites #####
+
+- PHP version 7.3, 7.4, 8.0, or 8.1
+
+##### Initial setup: #####
+
+```bash
+git clone https://github.com/sendgrid/sendgrid-php.git
+cd sendgrid-php
+composer install
+```
+
+### Environment Variables
+
+First, get your free Twilio SendGrid account [here](https://sendgrid.com/free?source=sendgrid-php).
+
+Next, update your environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys).
+
+```bash
+echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
+echo "sendgrid.env" >> .gitignore
+source ./sendgrid.env
+```
+
+##### Execute: #####
+
+See the [examples folder](examples) or [README](README.md) to get started quickly.
+
+We prefer the use of the Composer autoloader by loading `vendor/autoload.php`.
+
+The examples will load `sendgrid-php.php` which is in the project root. This file verifies the existence of the Composer autoloader and warns you if dependencies are missing.
+
+## Understanding the Codebase
+
+**/examples**
+
+Working examples that demonstrate usage.
+
+```bash
+php examples/example.php
+```
+
+**/test/unit**
+
+Unit tests for the HTTP client.
+
+**/test/integration**
+
+Unit tests for the HTTP client.
+
+**/lib**
+
+The interface to the Twilio SendGrid API. The subfolders are helpers.
+
+## Testing
+
+All PRs require passing tests before the PR will be reviewed. All test files are in the [`/test/unit`](test/unit) directory. For the purposes of contributing to this repo, please update or add relevant test files [here](test) with tests as you modify the code.
+
+The integration tests require a Twilio SendGrid mock API in order to execute. We've simplified setting this up using Docker to run the tests. You will just need [Docker Desktop](https://docs.docker.com/get-docker/) and `make`.
+
+Once these are available, simply execute the Docker test target to run all tests: `make test-docker`. This command can also be used to open an interactive shell into the container where this library is installed. To start a *bash* shell for example, use this command: `command=bash make test-docker`.
+
+## Style Guidelines & Naming Conventions
+
+Generally, we follow the style guidelines as suggested by the official language. However, we ask that you conform to the styles that already exist in the library. If you wish to deviate, please explain your reasoning.
+
+- [PSR2 Coding Standards](http://www.php-fig.org/psr/psr-2/)
+
+Please run your code through:
+
+- [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer)
+
+## Creating a Pull Request
+
+1. [Fork](https://help.github.com/fork-a-repo/) the project, clone your fork,
+ and configure the remotes:
+
+ ```bash
+ # Clone your fork of the repo into the current directory
+ git clone https://github.com/sendgrid/sendgrid-php
+
+ # Navigate to the newly cloned directory
+ cd sendgrid-php
+
+ # Assign the original repo to a remote called "upstream"
+ git remote add upstream https://github.com/sendgrid/sendgrid-php
+ ```
+
+2. If you cloned a while ago, get the latest changes from upstream:
+
+ ```bash
+ git checkout
+ git pull upstream
+ ```
+
+3. Create a new topic branch off the `development` branch to
+ contain your feature, change, or fix:
+
+ ```bash
+ git checkout development
+ git checkout -b
+ ```
+
+4. Commit your changes in logical chunks. Please adhere to these [git commit
+ message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
+ or your code is unlikely to be merged into the main project. Use Git's
+ [interactive rebase](https://help.github.com/articles/interactive-rebase)
+ feature to tidy up your commits before making them public.
+
+4a. Create tests.
+
+4b. Create or update the example code that demonstrates the functionality of this change to the code.
+
+5. Locally merge (or rebase) the upstream `development` branch into your topic branch:
+
+ ```bash
+ git pull [--rebase] upstream development
+ ```
+
+6. Push your topic branch up to your fork:
+
+ ```bash
+ git push origin
+ ```
+
+7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
+ with a clear title and description against the `development` branch. All tests must be passing before we will review the PR.
+
+## Code Reviews
+
+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/).
diff --git a/lib/sendgrid-php/Dockerfile b/lib/sendgrid-php/Dockerfile
new file mode 100644
index 000000000..8ad1cfd66
--- /dev/null
+++ b/lib/sendgrid-php/Dockerfile
@@ -0,0 +1,16 @@
+ARG version=latest
+FROM php:$version
+
+RUN apt-get update \
+ && apt-get install -y zip
+
+RUN curl -s https://getcomposer.org/installer | php \
+ && mv composer.phar /usr/local/bin/composer
+
+COPY prism/prism/nginx/cert.crt /usr/local/share/ca-certificates/cert.crt
+RUN update-ca-certificates
+
+WORKDIR /app
+COPY . .
+
+RUN make install
diff --git a/lib/sendgrid-php/FIRST_TIMERS.md b/lib/sendgrid-php/FIRST_TIMERS.md
new file mode 100644
index 000000000..2b86e33a9
--- /dev/null
+++ b/lib/sendgrid-php/FIRST_TIMERS.md
@@ -0,0 +1,53 @@
+# How To Contribute to Twilio SendGrid Repositories via GitHub
+Contributing to the Twilio SendGrid repositories is easy! All you need to do is find an open issue (see the bottom of this page for a list of repositories containing open issues), fix it and submit a pull request. Once you have submitted your pull request, the team can easily review it before it is merged into the repository.
+
+To make a pull request, follow these steps:
+
+1. Log into GitHub. If you do not already have a GitHub account, you will have to create one in order to submit a change. Click the Sign up link in the upper right-hand corner to create an account. Enter your username, password, and email address. If you are an employee of Twilio SendGrid, please use your full name with your GitHub account and enter Twilio SendGrid as your company so we can easily identify you.
+
+
+
+2. __[Fork](https://help.github.com/fork-a-repo/)__ the [sendgrid-php](https://github.com/sendgrid/sendgrid-php) repository:
+
+
+
+3. __Clone__ your fork via the following commands:
+
+```bash
+# Clone your fork of the repo into the current directory
+git clone https://github.com/your_username/sendgrid-php
+# Navigate to the newly cloned directory
+cd sendgrid-php
+# Assign the original repo to a remote called "upstream"
+git remote add upstream https://github.com/sendgrid/sendgrid-php
+```
+
+> Don't forget to replace *your_username* in the URL by your real GitHub username.
+
+4. __Create a new topic branch__ (off the main project development branch) to contain your feature, change, or fix:
+
+```bash
+git checkout -b
+```
+
+5. __Commit your changes__ in logical chunks.
+
+Please adhere to these [git commit message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) or your code is unlikely be merged into the main project. Use Git's [interactive rebase](https://help.github.com/articles/interactive-rebase) feature to tidy up your commits before making them public. Probably you will also have to create tests (if needed) or create or update the example code that demonstrates the functionality of this change to the code.
+
+6. __Locally merge (or rebase)__ the upstream development branch into your topic branch:
+
+```bash
+git pull [--rebase] upstream main
+```
+
+7. __Push__ your topic branch up to your fork:
+
+```bash
+git push origin
+```
+
+8. __[Open a Pull Request](https://help.github.com/articles/creating-a-pull-request/#changing-the-branch-range-and-destination-repository/)__ with a clear title and description against the `main` branch. All tests must be passing before we will review the PR.
+
+## Important notice
+
+Before creating a pull request, make sure that you respect the repository's constraints regarding contributions. You can find them in the [CONTRIBUTING.md](CONTRIBUTING.md) file.
diff --git a/lib/sendgrid-php/ISSUE_TEMPLATE.md b/lib/sendgrid-php/ISSUE_TEMPLATE.md
new file mode 100644
index 000000000..49967612d
--- /dev/null
+++ b/lib/sendgrid-php/ISSUE_TEMPLATE.md
@@ -0,0 +1,30 @@
+
+
+### Issue Summary
+A summary of the issue and the environment in which it occurs. If suitable, include the steps required to reproduce the bug. Please feel free to include screenshots, screencasts, or code examples.
+
+### Steps to Reproduce
+1. This is the first step
+2. This is the second step
+3. Further steps, etc.
+
+### Code Snippet
+```php
+# paste code here
+```
+
+### Exception/Log
+```
+# paste exception/log here
+```
+
+### Technical details:
+* sendgrid-php version:
+* php version:
+
diff --git a/lib/sendgrid-php/LICENSE b/lib/sendgrid-php/LICENSE
new file mode 100644
index 000000000..3154774a9
--- /dev/null
+++ b/lib/sendgrid-php/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (C) 2023, Twilio SendGrid, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/lib/sendgrid-php/Makefile b/lib/sendgrid-php/Makefile
new file mode 100644
index 000000000..490d4fa81
--- /dev/null
+++ b/lib/sendgrid-php/Makefile
@@ -0,0 +1,37 @@
+.PHONY: clean install ci-install test test-integ test-docker bundle
+
+clean:
+ @rm -rf vendor composer.lock sendgrid-php.zip
+
+php_version = `php -v | head -n 1 | cut -d " " -f 2`
+
+install: clean
+ifdef GIT_HUB_TOKEN
+ composer config -g github-oauth.github.com $(GIT_HUB_TOKEN)
+endif
+
+ composer install
+
+ifeq ($(dependencies), lowest)
+ composer update --prefer-lowest --prefer-stable -n
+endif
+
+ci-install: clean
+ composer install --no-dev
+
+test:
+ vendor/bin/phpunit test/unit --filter test*
+ vendor/bin/phpcs lib/*/*
+ vendor/bin/phpstan analyse --memory-limit 1G --no-progress --level 1 lib test
+
+test-integ: test
+ vendor/bin/phpunit test --filter test*
+
+version ?= latest
+test-docker:
+ curl -s https://raw.githubusercontent.com/sendgrid/sendgrid-oai/HEAD/prism/prism.sh -o prism.sh
+ dependencies=lowest version=$(version) bash ./prism.sh
+ dependencies=highest version=$(version) bash ./prism.sh
+
+bundle: ci-install
+ zip -r sendgrid-php.zip . -x \*.git\* \*composer.json\* \*scripts\* \*test\* \*prism\*
diff --git a/lib/sendgrid-php/PULL_REQUEST_TEMPLATE.md b/lib/sendgrid-php/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 000000000..7844f2459
--- /dev/null
+++ b/lib/sendgrid-php/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,31 @@
+
+
+# Fixes #
+
+A short description of what this PR does.
+
+### Checklist
+- [x] I acknowledge that all my contributions will be made under the project's license
+- [ ] I have made a material change to the repo (functionality, testing, spelling, grammar)
+- [ ] I have read the [Contribution Guidelines](https://github.com/sendgrid/sendgrid-php/blob/main/CONTRIBUTING.md) and my PR follows them
+- [ ] I have titled the PR appropriately
+- [ ] I have updated my branch with the main branch
+- [ ] I have added tests that prove my fix is effective or that my feature works
+- [ ] I have added the necessary documentation about the functionality in the appropriate .md file
+- [ ] I have added inline documentation to the code I modified
+
+If you have questions, please file a [support ticket](https://support.sendgrid.com).
diff --git a/lib/sendgrid-php/README.md b/lib/sendgrid-php/README.md
new file mode 100644
index 000000000..5cadc94c2
--- /dev/null
+++ b/lib/sendgrid-php/README.md
@@ -0,0 +1,206 @@
+
+
+[](https://github.com/sendgrid/sendgrid-php/actions/workflows/test-and-deploy.yml)
+[](https://packagist.org/packages/sendgrid/sendgrid)
+[](https://packagist.org/packages/sendgrid/sendgrid)
+[](LICENSE)
+[](https://twitter.com/sendgrid)
+[](https://github.com/sendgrid/sendgrid-php/graphs/contributors)
+[](https://www.codetriage.com/sendgrid/sendgrid-php)
+
+**NEW:**
+
+- Send SMS messages with [Twilio](USE_CASES.md#sms).
+
+**This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via PHP.**
+
+Version 7.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).
+
+**If you need support using SendGrid, please check the [Twilio SendGrid Support Help Center](https://support.sendgrid.com).**
+
+Please browse the rest of this README for further details.
+
+We appreciate your continued support, thank you!
+
+# Table of Contents
+
+* [Installation](#installation)
+* [Quick Start](#quick-start)
+* [Use Cases](#use-cases)
+* [Usage](#usage)
+* [Announcements](#announcements)
+* [How to Contribute](#contribute)
+* [Troubleshooting](#troubleshooting)
+* [About](#about)
+* [Support](#support)
+* [License](#license)
+
+
+# Installation
+
+## Prerequisites
+
+- PHP version 7.3, 7.4, 8.0, or 8.1
+- The Twilio SendGrid service, starting at the [free level](https://sendgrid.com/free?source=sendgrid-php) to send up to 40,000 emails for the first 30 days, then send 100 emails/day free forever or check out [our pricing](https://sendgrid.com/pricing?source=sendgrid-php).
+- For SMS messages, you will need a free [Twilio account](https://www.twilio.com/try-twilio?source=sendgrid-php).
+
+## Setup Environment Variables
+
+Update the development environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys), for example:
+
+1. Copy the sample env file to a new file named `.env`
+```bash
+cp .env.sample .env
+```
+2. Edit the `.env` file to include your `SENDGRID_API_KEY`
+3. Source the `.env` file
+```bash
+source ./.env
+```
+
+## Install Package
+
+Add Twilio SendGrid to your `composer.json` file. If you are not using [Composer](http://getcomposer.org), we highly recommend it. It's an excellent way to manage dependencies in your PHP application.
+
+```json
+{
+ "require": {
+ "sendgrid/sendgrid": "~7"
+ }
+}
+```
+
+### Alternative: Install package from zip
+
+If you are not using Composer, simply download and install the **[latest packaged release of the library as a zip](https://github.com/sendgrid/sendgrid-php/releases/download/8.1.2/sendgrid-php.zip)**.
+
+[**⬇︎ Download Packaged Library ⬇︎**](https://github.com/sendgrid/sendgrid-php/releases/download/8.1.2/sendgrid-php.zip)
+
+Previous versions of the library can be downloaded directly from [GitHub](https://github.com/sendgrid/sendgrid-php/releases).
+
+## Dependencies
+
+- The Twilio SendGrid Service, starting at the [free level](https://sendgrid.com/free?source=sendgrid-php)
+- The dependency-free [php-http-client](https://github.com/sendgrid/php-http-client)
+
+
+# Quick Start
+
+Include the proper lines from below at the top of each example based on your installation method:
+
+```php
+ with the path to the sendgrid-php.php file
+// require_once '/sendgrid-php.php';
+```
+
+## Hello Email
+
+The following is the minimum needed code to send an email. You may find more examples in our USE_CASES file:
+
+```php
+$email = new \SendGrid\Mail\Mail();
+$email->setFrom("test@example.com", "Example User");
+$email->setSubject("Sending with Twilio SendGrid is Fun");
+$email->addTo("test@example.com", "Example User");
+$email->addContent("text/plain", "and easy to do anywhere, even with PHP");
+$email->addContent(
+ "text/html", "and easy to do anywhere, even with PHP"
+);
+$sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
+try {
+ $response = $sendgrid->send($email);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: '. $e->getMessage() ."\n";
+}
+```
+
+The `SendGrid\Mail` constructor creates a [personalization object](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/personalizations.html) for you. [Here](USE_CASES.md#kitchen-sink) is an example of how to add to it.
+
+## General v3 Web API Usage (With Fluent Interface)
+
+```php
+$apiKey = getenv('SENDGRID_API_KEY');
+$sg = new \SendGrid($apiKey);
+
+try {
+ $response = $sg->client->suppression()->bounces()->get();
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: '. $e->getMessage(). "\n";
+}
+```
+
+## General v3 Web API Usage (Without Fluent Interface)
+
+```php
+$apiKey = getenv('SENDGRID_API_KEY');
+$sg = new \SendGrid($apiKey);
+
+try {
+ $response = $sg->client->_("suppression/bounces")->get();
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: '. $e->getMessage(). "\n";
+}
+```
+
+
+# Use Cases
+
+[Examples of common API use cases](USE_CASES.md), such as how to send an email with a transactional template.
+
+
+# Usage
+
+- [Twilio SendGrid Docs](https://sendgrid.com/docs/API_Reference/index.html)
+- [Generic Library Usage
+ Documentation](USAGE.md)
+- [Example Code](USE_CASES.md)
+
+
+# Announcements
+
+v7 has been released! Please see the [release notes](https://github.com/sendgrid/sendgrid-php/releases/tag/v7.0.0) for details.
+
+All updates to this library are documented in our [CHANGELOG](CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-php/releases).
+
+
+# How to Contribute
+
+We encourage contribution to our libraries (you might even score some nifty swag), please see our [CONTRIBUTING](CONTRIBUTING.md) guide for details.
+
+Quick links:
+
+- [Feature Request](CONTRIBUTING.md#feature_request)
+- [Bug Reports](CONTRIBUTING.md#submit_a_bug_report)
+- [Improvements to the Codebase](CONTRIBUTING.md#improvements_to_the_codebase)
+- [Review Pull Requests](CONTRIBUTING.md#code-reviews)
+
+
+# Troubleshooting
+
+Please see our [troubleshooting guide](TROUBLESHOOTING.md) for common library issues.
+
+
+# About
+
+sendgrid-php is maintained and funded by Twilio SendGrid, Inc. The names and logos for sendgrid-php are trademarks of Twilio SendGrid, Inc.
+
+
+# Support
+
+For product support, please check the [Twilio SendGrid Support Help Center](https://support.sendgrid.com).
+
+# License
+[The MIT License (MIT)](LICENSE)
diff --git a/lib/sendgrid-php/TROUBLESHOOTING.md b/lib/sendgrid-php/TROUBLESHOOTING.md
new file mode 100644
index 000000000..3628ef549
--- /dev/null
+++ b/lib/sendgrid-php/TROUBLESHOOTING.md
@@ -0,0 +1,144 @@
+If you have an issue logging into your Twilio SendGrid account, please read this [document](https://sendgrid.com/docs/ui/account-and-settings/troubleshooting-login/). For any questions regarding login issues, please contact our [support team](https://support.sendgrid.com).
+
+If you have a non-library Twilio SendGrid issue, please contact our [support team](https://support.sendgrid.com).
+
+If you can't find a solution below, please open an [issue](https://github.com/sendgrid/sendgrid-php/issues).
+
+## Table of Contents
+
+- [Table of Contents](#table-of-contents)
+- [Migrating from v2 to v3](#migrating-from-v2-to-v3)
+- [Continue Using v2](#continue-using-v2)
+- [Testing v3 /mail/send Calls Directly](#testing-v3-mailsend-calls-directly)
+- [Error Messages](#error-messages)
+- [Versions](#versions)
+- [Environment Variables and Your Twilio SendGrid API Key](#environment-variables-and-your-twilio-sendgrid-api-key)
+- [Using the Package Manager](#using-the-package-manager)
+- [Fixing Error 415](#fixing-error-415)
+- [Viewing the Request Body](#viewing-the-request-body)
+- [Google App Engine installation](#google-app-engine-installation)
+- [Verifying Event Webhooks](#signed-webhooks)
+
+
+## Migrating from v2 to v3
+
+In this context, we are referring to the version of the Twilio SendGrid API.
+
+Please review [our guide](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/how_to_migrate_from_v2_to_v3_mail_send.html) on how to migrate from v2 to v3.
+
+
+## Continue Using v2
+
+In this context, we are referring to the version of the Twilio SendGrid API.
+
+[Here](https://github.com/sendgrid/sendgrid-php/releases/tag/v4.0.4) is the last working version with v2 support.
+
+Using composer:
+
+```json
+{
+ "require": {
+ "sendgrid/sendgrid": "~4.0.4"
+ }
+}
+```
+
+Download packaged zip [here](https://sendgrid-open-source.s3.amazonaws.com/sendgrid-php/versions/sendgrid-php-75970eb.zip).
+
+
+## Testing v3 /mail/send Calls Directly
+
+[Here](https://sendgrid.com/docs/for-developers/sending-email/curl-examples/) are some cURL examples for common use cases.
+
+
+## Error Messages
+
+Failed requests will always return an error response, including a response code, a message explaining the reason for the error, and a link to any relevant documentation that may help you troubleshoot the problem.
+
+To read the error message returned by Twilio SendGrid's API:
+
+```php
+try {
+ $response = $sendgrid->send($email);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n"; // Twilio SendGrid specific errors are found here
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+```
+
+You may find complete documentation [here](https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html).
+
+
+## Versions
+
+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](CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-php/releases) section.
+
+
+## Environment Variables and Your Twilio SendGrid API Key
+
+All of our examples assume you are using [environment variables](https://github.com/sendgrid/sendgrid-php#setup-environment-variables) to hold your Twilio SendGrid API key.
+
+If you choose to add your Twilio SendGrid API key directly (not recommended):
+
+`$apiKey = getenv('SENDGRID_API_KEY');`
+
+becomes
+
+`$apiKey = 'SENDGRID_API_KEY';`
+
+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.
+
+
+## Using the Package Manager
+
+We upload this library to [Packagist](https://packagist.org/packages/sendgrid/sendgrid) whenever we make a release. This allows you to use [composer](https://getcomposer.org) for easy installation.
+
+In most cases we recommend you download the latest version of the library, but if you need a different version, please use:
+
+```json
+{
+ "require": {
+ "sendgrid/sendgrid": "~X.X.X"
+ }
+}
+```
+
+
+## Fixing Error 415
+
+If you're getting the following error while using this library:
+
+`Content-Type should be application/json.`
+
+It is most likely due to a linebreak in your API key. Passing your key through `trim` should fix this:
+
+`$apiKey = trim($apiKey)`
+
+
+## Viewing the Request Body
+
+When debugging or testing, it may be useful to examine the raw request body to compare against the [documented format](https://sendgrid.com/docs/API_Reference/api_v3.html).
+
+You can do this right before you call `$response = $sg->send($email);` like so:
+
+```php
+echo json_encode($email, JSON_PRETTY_PRINT);
+```
+
+
+## Google App Engine installation
+
+Please refer to [`USE_CASES.md`](USE_CASES.md#GAE-instructions) for additional instructions.
+
+
+## Signed Webhook Verification
+
+Twilio SendGrid's Event Webhook will notify a URL via HTTP POST with information about events that occur as your mail is processed. [This](https://docs.sendgrid.com/for-developers/tracking-events/getting-started-event-webhook-security-features) article covers all you need to know to secure the Event Webhook, allowing you to verify that incoming requests originate from Twilio SendGrid. The sendgrid-php library can help you verify these Signed Event Webhooks.
+
+You can find the usage example [here](examples/helpers/eventwebhook/example.php) and the tests [here](test/unit/EventWebhookTest.php).
+If you are still having trouble getting the validation to work, follow the following instructions:
+- Be sure to use the *raw* payload for validation
+- Be sure to include a trailing carriage return and newline in your payload
+- In case of multi-event webhooks, make sure you include the trailing newline and carriage return after *each* event
diff --git a/lib/sendgrid-php/UPGRADE.md b/lib/sendgrid-php/UPGRADE.md
new file mode 100644
index 000000000..6de142cea
--- /dev/null
+++ b/lib/sendgrid-php/UPGRADE.md
@@ -0,0 +1,8 @@
+# Upgrade Guide
+
+_MAJOR version bumps will have upgrade notes posted here._
+
+[2022-05-04] 7.x.x to 8.x.x
+---------------------------
+
+### CHANGED - Drop support for PHP versions 5.6, 7.0, 7.1, and 7.2 which are EOL.
diff --git a/lib/sendgrid-php/USAGE.md b/lib/sendgrid-php/USAGE.md
new file mode 100644
index 000000000..713f25884
--- /dev/null
+++ b/lib/sendgrid-php/USAGE.md
@@ -0,0 +1,5127 @@
+This documentation is based on our [OAI specification](https://github.com/sendgrid/sendgrid-oai).
+
+# INITIALIZATION
+
+```php
+/sendgrid-php.php';
+
+$apiKey = getenv('SENDGRID_API_KEY');
+$sg = new \SendGrid($apiKey);
+```
+
+# Table of Contents
+
+* [ACCESS SETTINGS](#access-settings)
+* [ALERTS](#alerts)
+* [API KEYS](#api-keys)
+* [ASM](#asm)
+* [BROWSERS](#browsers)
+* [CAMPAIGNS](#campaigns)
+* [CATEGORIES](#categories)
+* [CLIENTS](#clients)
+* [CONTACTDB](#contactdb)
+* [DEVICES](#devices)
+* [EMAIL ACTIVITY](#email-activity)
+* [GEO](#geo)
+* [IPS](#ips)
+* [MAIL](#mail)
+* [MAIL SETTINGS](#mail-settings)
+* [MAILBOX PROVIDERS](#mailbox-providers)
+* [PARTNER SETTINGS](#partner-settings)
+* [SCOPES](#scopes)
+* [SENDERS](#senders)
+* [SENDER AUTHENTICATION](#sender-authentication)
+* [STATS](#stats)
+* [SUBUSERS](#subusers)
+* [SUPPRESSION](#suppression)
+* [TEMPLATES](#templates)
+* [TRACKING SETTINGS](#tracking-settings)
+* [USER](#user)
+
+
+
+# ACCESS SETTINGS
+
+## Retrieve all recent access attempts
+
+**This endpoint allows you to retrieve a list of all of the IP addresses that recently attempted to access your account either through the User Interface or the API.**
+
+IP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your own IP address from the whitelist, thus preventing yourself from accessing your account.
+
+For more information, please see our [User Guide](http://sendgrid.com/docs/User_Guide/Settings/ip_access_management.html).
+
+### GET /access_settings/activity
+
+
+```php
+$query_params = json_decode('{"limit": 1}');
+$response = $sg->client->access_settings()->activity()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Add one or more IPs to the whitelist
+
+**This endpoint allows you to add one or more IP addresses to your IP whitelist.**
+
+When adding an IP to your whitelist, include the IP address in an array. You can whitelist one IP at a time, or you can whitelist multiple IPs at once.
+
+IP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your own IP address from the whitelist, thus preventing yourself from accessing your account.
+
+For more information, please see our [User Guide](http://sendgrid.com/docs/User_Guide/Settings/ip_access_management.html).
+
+### POST /access_settings/whitelist
+
+
+```php
+$request_body = json_decode('{
+ "ips": [
+ {
+ "ip": "192.168.1.1"
+ },
+ {
+ "ip": "192.*.*.*"
+ },
+ {
+ "ip": "192.168.1.3/32"
+ }
+ ]
+}');
+$response = $sg->client->access_settings()->whitelist()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a list of currently whitelisted IPs
+
+**This endpoint allows you to retrieve a list of IP addresses that are currently whitelisted.**
+
+IP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your own IP address from the whitelist, thus preventing yourself from accessing your account.
+
+For more information, please see our [User Guide](http://sendgrid.com/docs/User_Guide/Settings/ip_access_management.html).
+
+### GET /access_settings/whitelist
+
+
+```php
+$response = $sg->client->access_settings()->whitelist()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Remove one or more IPs from the whitelist
+
+**This endpoint allows you to remove one or more IPs from your IP whitelist.**
+
+You can remove one IP at a time, or you can remove multiple IP addresses.
+
+IP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your own IP address from the whitelist, thus preventing yourself from accessing your account.
+
+For more information, please see our [User Guide](http://sendgrid.com/docs/User_Guide/Settings/ip_access_management.html).
+
+### DELETE /access_settings/whitelist
+
+
+```php
+$request_body = json_decode('{
+ "ids": [
+ 1,
+ 2,
+ 3
+ ]
+}');
+$response = $sg->client->access_settings()->whitelist()->delete($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a specific whitelisted IP
+
+**This endpoint allows you to retrieve a specific IP address that has been whitelisted.**
+
+You must include the ID for the specific IP address you want to retrieve in your call.
+
+IP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your own IP address from the whitelist, thus preventing yourself from accessing your account.
+
+For more information, please see our [User Guide](http://sendgrid.com/docs/User_Guide/Settings/ip_access_management.html).
+
+### GET /access_settings/whitelist/{rule_id}
+
+
+```php
+$rule_id = "test_url_param";
+$response = $sg->client->access_settings()->whitelist()->_($rule_id)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Remove a specific IP from the whitelist
+
+**This endpoint allows you to remove a specific IP address from your IP whitelist.**
+
+When removing a specific IP address from your whitelist, you must include the ID in your call.
+
+IP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your own IP address from the whitelist, thus preventing yourself from accessing your account.
+
+For more information, please see our [User Guide](http://sendgrid.com/docs/User_Guide/Settings/ip_access_management.html).
+
+### DELETE /access_settings/whitelist/{rule_id}
+
+
+```php
+$rule_id = "test_url_param";
+$response = $sg->client->access_settings()->whitelist()->_($rule_id)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# ALERTS
+
+## Create a new Alert
+
+**This endpoint allows you to create a new alert.**
+
+Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics.
+* Usage alerts allow you to set the threshold at which an alert will be sent.
+* Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly".
+
+For more information about alerts, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/alerts.html).
+
+### POST /alerts
+
+
+```php
+$request_body = json_decode('{
+ "email_to": "example@example.com",
+ "frequency": "daily",
+ "type": "stats_notification"
+}');
+$response = $sg->client->alerts()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all alerts
+
+**This endpoint allows you to retrieve all of your alerts.**
+
+Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics.
+* Usage alerts allow you to set the threshold at which an alert will be sent.
+* Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly".
+
+For more information about alerts, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/alerts.html).
+
+### GET /alerts
+
+
+```php
+$response = $sg->client->alerts()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update an alert
+
+**This endpoint allows you to update an alert.**
+
+Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics.
+* Usage alerts allow you to set the threshold at which an alert will be sent.
+* Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly".
+
+For more information about alerts, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/alerts.html).
+
+### PATCH /alerts/{alert_id}
+
+
+```php
+$request_body = json_decode('{
+ "email_to": "example@example.com"
+}');
+$alert_id = "test_url_param";
+$response = $sg->client->alerts()->_($alert_id)->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a specific alert
+
+**This endpoint allows you to retrieve a specific alert.**
+
+Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics.
+* Usage alerts allow you to set the threshold at which an alert will be sent.
+* Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly".
+
+For more information about alerts, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/alerts.html).
+
+### GET /alerts/{alert_id}
+
+
+```php
+$alert_id = "test_url_param";
+$response = $sg->client->alerts()->_($alert_id)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete an alert
+
+**This endpoint allows you to delete an alert.**
+
+Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics.
+* Usage alerts allow you to set the threshold at which an alert will be sent.
+* Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly".
+
+For more information about alerts, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/alerts.html).
+
+### DELETE /alerts/{alert_id}
+
+
+```php
+$alert_id = "test_url_param";
+$response = $sg->client->alerts()->_($alert_id)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# API KEYS
+
+## Create API keys
+
+**This endpoint allows you to create a new random API Key for the user.**
+
+A JSON request body containing a "name" property is required. If a number of maximum keys is reached, HTTP 403 will be returned.
+
+There is a limit of 100 API Keys on your account.
+
+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).
+
+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.
+
+### POST /api_keys
+
+
+```php
+$request_body = json_decode('{
+ "name": "My API Key",
+ "sample": "data",
+ "scopes": [
+ "mail.send",
+ "alerts.create",
+ "alerts.read"
+ ]
+}');
+$response = $sg->client->api_keys()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all API Keys belonging to the authenticated user
+
+**This endpoint allows you to retrieve all API Keys that belong to the authenticated user.**
+
+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).
+
+### GET /api_keys
+
+
+```php
+$query_params = json_decode('{"limit": 1}');
+$response = $sg->client->api_keys()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update the name & scopes of an API Key
+
+**This endpoint allows you to update the name and scopes of a given API key.**
+
+A JSON request body with a "name" property is required.
+Most provide the list of all the scopes an API key should have.
+
+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).
+
+
+### PUT /api_keys/{api_key_id}
+
+
+```php
+$request_body = json_decode('{
+ "name": "A New Hope",
+ "scopes": [
+ "user.profile.read",
+ "user.profile.update"
+ ]
+}');
+$api_key_id = "test_url_param";
+$response = $sg->client->api_keys()->_($api_key_id)->put($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update API keys
+
+**This endpoint allows you to update the name of an existing API Key.**
+
+A JSON request body with a "name" property is required.
+
+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).
+
+## URI Parameters
+
+| URI Parameter | Type | Required? | Description |
+|---|---|---|---|
+|api_key_id |string | required | The ID of the API Key you are updating.|
+
+### PATCH /api_keys/{api_key_id}
+
+
+```php
+$request_body = json_decode('{
+ "name": "A New Hope"
+}');
+$api_key_id = "test_url_param";
+$response = $sg->client->api_keys()->_($api_key_id)->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve an existing API Key
+
+**This endpoint allows you to retrieve a single API key.**
+
+If the API Key ID does not exist an HTTP 404 will be returned.
+
+### GET /api_keys/{api_key_id}
+
+
+```php
+$api_key_id = "test_url_param";
+$response = $sg->client->api_keys()->_($api_key_id)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete API keys
+
+**This endpoint allows you to revoke an existing API Key**
+
+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.
+
+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).
+
+## URI Parameters
+
+| URI Parameter | Type | Required? | Description |
+|---|---|---|---|
+|api_key_id |string | required | The ID of the API Key you are deleting.|
+
+### DELETE /api_keys/{api_key_id}
+
+
+```php
+$api_key_id = "test_url_param";
+$response = $sg->client->api_keys()->_($api_key_id)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# ASM
+
+## Create a new suppression group
+
+**This endpoint allows you to create a new suppression group.**
+
+Suppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts.
+
+The **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions.
+
+Each user can create up to 25 different suppression groups.
+
+### POST /asm/groups
+
+
+```php
+$request_body = json_decode('{
+ "description": "Suggestions for products our users might like.",
+ "is_default": true,
+ "name": "Product Suggestions"
+}');
+$response = $sg->client->asm()->groups()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve information about multiple suppression groups
+
+**This endpoint allows you to retrieve information about multiple suppression groups.**
+
+This endpoint will return information for each group ID that you include in your request. To add a group ID to your request, simply append `&id=` followed by the group ID.
+
+Suppressions are a list of email addresses that will not receive content sent under a given [group](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html).
+
+Suppression groups, or [unsubscribe groups](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html), allow you to label a category of content that you regularly send. This gives your recipients the ability to opt out of a specific set of your email. For example, you might define a group for your transactional email, and one for your marketing email so that your users can continue receiving your transactional email without having to receive your marketing content.
+
+### GET /asm/groups
+
+
+```php
+$query_params = json_decode('{"id": 1}');
+$response = $sg->client->asm()->groups()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update a suppression group.
+
+**This endpoint allows you to update or change a suppression group.**
+
+Suppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts.
+
+The **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions.
+
+Each user can create up to 25 different suppression groups.
+
+### PATCH /asm/groups/{group_id}
+
+
+```php
+$request_body = json_decode('{
+ "description": "Suggestions for items our users might like.",
+ "id": 103,
+ "name": "Item Suggestions"
+}');
+$group_id = "test_url_param";
+$response = $sg->client->asm()->groups()->_($group_id)->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Get information on a single suppression group.
+
+**This endpoint allows you to retrieve a single suppression group.**
+
+Suppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts.
+
+The **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions.
+
+Each user can create up to 25 different suppression groups.
+
+### GET /asm/groups/{group_id}
+
+
+```php
+$group_id = "test_url_param";
+$response = $sg->client->asm()->groups()->_($group_id)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a suppression group.
+
+**This endpoint allows you to delete a suppression group.**
+
+You can only delete groups that have not been attached to sent mail in the last 60 days. If a recipient uses the "one-click unsubscribe" option on an email associated with a deleted group, that recipient will be added to the global suppression list.
+
+Suppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts.
+
+The **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions.
+
+Each user can create up to 25 different suppression groups.
+
+### DELETE /asm/groups/{group_id}
+
+
+```php
+$group_id = "test_url_param";
+$response = $sg->client->asm()->groups()->_($group_id)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Add suppressions to a suppression group
+
+**This endpoint allows you to add email addresses to an unsubscribe group.**
+
+If you attempt to add suppressions to a group that has been deleted or does not exist, the suppressions will be added to the global suppressions list.
+
+Suppressions are recipient email addresses that are added to [unsubscribe groups](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html). Once a recipient's address is on the suppressions list for an unsubscribe group, they will not receive any emails that are tagged with that unsubscribe group.
+
+### POST /asm/groups/{group_id}/suppressions
+
+
+```php
+$request_body = json_decode('{
+ "recipient_emails": [
+ "test1@example.com",
+ "test2@example.com"
+ ]
+}');
+$group_id = "test_url_param";
+$response = $sg->client->asm()->groups()->_($group_id)->suppressions()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all suppressions for a suppression group
+
+**This endpoint allows you to retrieve all suppressed email addresses belonging to the given group.**
+
+Suppressions are recipient email addresses that are added to [unsubscribe groups](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html). Once a recipient's address is on the suppressions list for an unsubscribe group, they will not receive any emails that are tagged with that unsubscribe group.
+
+### GET /asm/groups/{group_id}/suppressions
+
+
+```php
+$group_id = "test_url_param";
+$response = $sg->client->asm()->groups()->_($group_id)->suppressions()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Search for suppressions within a group
+
+**This endpoint allows you to search a suppression group for multiple suppressions.**
+
+When given a list of email addresses and a group ID, this endpoint will return only the email addresses that have been unsubscribed from the given group.
+
+Suppressions are a list of email addresses that will not receive content sent under a given [group](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html).
+
+### POST /asm/groups/{group_id}/suppressions/search
+
+
+```php
+$request_body = json_decode('{
+ "recipient_emails": [
+ "exists1@example.com",
+ "exists2@example.com",
+ "doesnotexists@example.com"
+ ]
+}');
+$group_id = "test_url_param";
+$response = $sg->client->asm()->groups()->_($group_id)->suppressions()->search()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a suppression from a suppression group
+
+**This endpoint allows you to remove a suppressed email address from the given suppression group.**
+
+Suppressions are recipient email addresses that are added to [unsubscribe groups](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html). Once a recipient's address is on the suppressions list for an unsubscribe group, they will not receive any emails that are tagged with that unsubscribe group.
+
+### DELETE /asm/groups/{group_id}/suppressions/{email}
+
+
+```php
+$group_id = "test_url_param";
+$email = "test_url_param";
+$response = $sg->client->asm()->groups()->_($group_id)->suppressions()->_($email)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all suppressions
+
+**This endpoint allows you to retrieve a list of all suppressions.**
+
+Suppressions are a list of email addresses that will not receive content sent under a given [group](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html).
+
+### GET /asm/suppressions
+
+
+```php
+$response = $sg->client->asm()->suppressions()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Add recipient addresses to the global suppression group.
+
+**This endpoint allows you to add one or more email addresses to the global suppressions group.**
+
+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).
+
+### POST /asm/suppressions/global
+
+
+```php
+$request_body = json_decode('{
+ "recipient_emails": [
+ "test1@example.com",
+ "test2@example.com"
+ ]
+}');
+$response = $sg->client->asm()->suppressions()->global()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a Global Suppression
+
+**This endpoint allows you to retrieve a global suppression. You can also use this endpoint to confirm if an email address is already globally suppressed.**
+
+If the email address you include in the URL path parameter `{email}` is already globally suppressed, the response will include that email address. If the address you enter for `{email}` is not globally suppressed, an empty JSON object `{}` will be returned.
+
+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).
+
+### GET /asm/suppressions/global/{email}
+
+
+```php
+$email = "test_url_param";
+$response = $sg->client->asm()->suppressions()->global()->_($email)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a Global Suppression
+
+**This endpoint allows you to remove an email address from the global suppressions group.**
+
+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).
+
+### DELETE /asm/suppressions/global/{email}
+
+
+```php
+$email = "test_url_param";
+$response = $sg->client->asm()->suppressions()->global()->_($email)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all suppression groups for an email address
+
+**This endpoint returns the list of all groups that the given email address has been unsubscribed from.**
+
+Suppressions are a list of email addresses that will not receive content sent under a given [group](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html).
+
+### GET /asm/suppressions/{email}
+
+
+```php
+$email = "test_url_param";
+$response = $sg->client->asm()->suppressions()->_($email)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# BROWSERS
+
+## Retrieve email statistics by a browser.
+
+**This endpoint allows you to retrieve your email statistics segmented by browser type.**
+
+**We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints.
+
+Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/index.html).
+
+### GET /browsers/stats
+
+
+```php
+$query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "browsers": "test_string", "limit": "test_string", "offset": "test_string", "start_date": "2016-01-01"}');
+$response = $sg->client->browsers()->stats()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# CAMPAIGNS
+
+## Create a Campaign
+
+**This endpoint allows you to create a campaign.**
+
+Our Marketing Campaigns API lets you create, manage, send, and schedule campaigns.
+
+Note: In order to send or schedule the campaign, you will be required to provide a subject, sender ID, content (we suggest both HTML and plain text), and at least one list or segment ID. This information is not required when you create a campaign.
+
+For more information:
+
+* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)
+
+### POST /campaigns
+
+
+```php
+$request_body = json_decode('{
+ "categories": [
+ "spring line"
+ ],
+ "custom_unsubscribe_url": "",
+ "html_content": "Check out our spring line!
",
+ "ip_pool": "marketing",
+ "list_ids": [
+ 110,
+ 124
+ ],
+ "plain_content": "Check out our spring line!",
+ "segment_ids": [
+ 110
+ ],
+ "sender_id": 124451,
+ "subject": "New Products for Spring!",
+ "suppression_group_id": 42,
+ "title": "March Newsletter"
+}');
+$response = $sg->client->campaigns()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all Campaigns
+
+**This endpoint allows you to retrieve a list of all of your campaigns.**
+
+Returns campaigns in reverse order they were created (newest first).
+
+Returns an empty array if no campaigns exist.
+
+For more information:
+
+* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)
+
+### GET /campaigns
+
+
+```php
+$query_params = json_decode('{"limit": 1, "offset": 1}');
+$response = $sg->client->campaigns()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update a Campaign
+
+Update a campaign. This is especially useful if you only set up the campaign using POST /campaigns, but didn't set many of the parameters.
+
+For more information:
+
+* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)
+
+### PATCH /campaigns/{campaign_id}
+
+
+```php
+$request_body = json_decode('{
+ "categories": [
+ "summer line"
+ ],
+ "html_content": "Check out our summer line!
",
+ "plain_content": "Check out our summer line!",
+ "subject": "New Products for Summer!",
+ "title": "May Newsletter"
+}');
+$campaign_id = "test_url_param";
+$response = $sg->client->campaigns()->_($campaign_id)->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a single campaign
+
+**This endpoint allows you to retrieve a specific campaign.**
+
+Our Marketing Campaigns API lets you create, manage, send, and schedule campaigns.
+
+For more information:
+
+* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)
+
+### GET /campaigns/{campaign_id}
+
+
+```php
+$campaign_id = "test_url_param";
+$response = $sg->client->campaigns()->_($campaign_id)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a Campaign
+
+**This endpoint allows you to delete a specific campaign.**
+
+Our Marketing Campaigns API lets you create, manage, send, and schedule campaigns.
+
+For more information:
+
+* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)
+
+### DELETE /campaigns/{campaign_id}
+
+
+```php
+$campaign_id = "test_url_param";
+$response = $sg->client->campaigns()->_($campaign_id)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update a Scheduled Campaign
+
+**This endpoint allows to you change the scheduled time and date for a campaign to be sent.**
+
+For more information:
+
+* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)
+
+### PATCH /campaigns/{campaign_id}/schedules
+
+
+```php
+$request_body = json_decode('{
+ "send_at": 1489451436
+}');
+$campaign_id = "test_url_param";
+$response = $sg->client->campaigns()->_($campaign_id)->schedules()->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Schedule a Campaign
+
+**This endpoint allows you to schedule a specific date and time for your campaign to be sent.**
+
+For more information:
+
+* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)
+
+### POST /campaigns/{campaign_id}/schedules
+
+
+```php
+$request_body = json_decode('{
+ "send_at": 1489771528
+}');
+$campaign_id = "test_url_param";
+$response = $sg->client->campaigns()->_($campaign_id)->schedules()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## View Scheduled Time of a Campaign
+
+**This endpoint allows you to retrieve the date and time that the given campaign has been scheduled to be sent.**
+
+For more information:
+
+* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)
+
+### GET /campaigns/{campaign_id}/schedules
+
+
+```php
+$campaign_id = "test_url_param";
+$response = $sg->client->campaigns()->_($campaign_id)->schedules()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Unschedule a Scheduled Campaign
+
+**This endpoint allows you to unschedule a campaign that has already been scheduled to be sent.**
+
+A successful unschedule will return a 204.
+If the specified campaign is in the process of being sent, the only option is to cancel (a different method).
+
+For more information:
+
+* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)
+
+### DELETE /campaigns/{campaign_id}/schedules
+
+
+```php
+$campaign_id = "test_url_param";
+$response = $sg->client->campaigns()->_($campaign_id)->schedules()->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Send a Campaign
+
+**This endpoint allows you to immediately send a campaign at the time you make the API call.**
+
+Normally a POST would have a request body, but since this endpoint is telling us to send a resource that is already created, a request body is not needed.
+
+For more information:
+
+* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)
+
+### POST /campaigns/{campaign_id}/schedules/now
+
+
+```php
+$campaign_id = "test_url_param";
+$response = $sg->client->campaigns()->_($campaign_id)->schedules()->now()->post();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Send a Test Campaign
+
+**This endpoint allows you to send a test campaign.**
+
+To send to multiple addresses, use an array for the JSON "to" value ["one@address", "two@address"]
+
+For more information:
+
+* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html)
+
+### POST /campaigns/{campaign_id}/schedules/test
+
+
+```php
+$request_body = json_decode('{
+ "to": "your.email@example.com"
+}');
+$campaign_id = "test_url_param";
+$response = $sg->client->campaigns()->_($campaign_id)->schedules()->test()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# CATEGORIES
+
+## Retrieve all categories
+
+**This endpoint allows you to retrieve a list of all of your categories.**
+
+Categories can help organize your email analytics by enabling you to tag emails by type or broad topic. You can define your own custom categories. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/categories.html).
+
+### GET /categories
+
+
+```php
+$query_params = json_decode('{"category": "test_string", "limit": 1, "offset": 1}');
+$response = $sg->client->categories()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve Email Statistics for Categories
+
+**This endpoint allows you to retrieve all of your email statistics for each of your categories.**
+
+If you do not define any query parameters, this endpoint will return a sum for each category in groups of 10.
+
+Categories allow you to group your emails together according to broad topics that you define. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/categories.html).
+
+### GET /categories/stats
+
+
+```php
+$query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01", "categories": "test_string"}');
+$response = $sg->client->categories()->stats()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve sums of email stats for each category [Needs: Stats object defined, has category ID?]
+
+**This endpoint allows you to retrieve the total sum of each email statistic for every category over the given date range.**
+
+If you do not define any query parameters, this endpoint will return a sum for each category in groups of 10.
+
+Categories allow you to group your emails together according to broad topics that you define. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/categories.html).
+
+Note: Category statistics are available for the previous thirteen months only.
+
+### GET /categories/stats/sums
+
+
+```php
+$query_params = json_decode('{"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"}');
+$response = $sg->client->categories()->stats()->sums()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# CLIENTS
+
+## Retrieve email statistics by client type.
+
+**This endpoint allows you to retrieve your email statistics segmented by client type.**
+
+**We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints.
+
+Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/index.html).
+
+### GET /clients/stats
+
+
+```php
+$query_params = json_decode('{"aggregated_by": "day", "start_date": "2016-01-01", "end_date": "2016-04-01"}');
+$response = $sg->client->clients()->stats()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve stats by a specific client type.
+
+**This endpoint allows you to retrieve your email statistics segmented by a specific client type.**
+
+**We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints.
+
+## Available Client Types
+- phone
+- tablet
+- webmail
+- desktop
+
+Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/index.html).
+
+### GET /clients/{client_type}/stats
+
+
+```php
+$query_params = json_decode('{"aggregated_by": "day", "start_date": "2016-01-01", "end_date": "2016-04-01"}');
+$client_type = "test_url_param";
+$response = $sg->client->clients()->_($client_type)->stats()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# CONTACTDB
+
+## Create a Custom Field
+
+**This endpoint allows you to create a custom field.**
+
+The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
+
+### POST /contactdb/custom_fields
+
+
+```php
+$request_body = json_decode('{
+ "name": "pet",
+ "type": "text"
+}');
+$response = $sg->client->contactdb()->custom_fields()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all custom fields
+
+**This endpoint allows you to retrieve all custom fields.**
+
+The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
+
+### GET /contactdb/custom_fields
+
+
+```php
+$response = $sg->client->contactdb()->custom_fields()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a Custom Field
+
+**This endpoint allows you to retrieve a custom field by ID.**
+
+The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
+
+### GET /contactdb/custom_fields/{custom_field_id}
+
+
+```php
+$custom_field_id = "test_url_param";
+$response = $sg->client->contactdb()->custom_fields()->_($custom_field_id)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a Custom Field
+
+**This endpoint allows you to delete a custom field by ID.**
+
+The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
+
+### DELETE /contactdb/custom_fields/{custom_field_id}
+
+
+```php
+$custom_field_id = "test_url_param";
+$response = $sg->client->contactdb()->custom_fields()->_($custom_field_id)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Create a List
+
+**This endpoint allows you to create a list for your recipients.**
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+### POST /contactdb/lists
+
+
+```php
+$request_body = json_decode('{
+ "name": "your list name"
+}');
+$response = $sg->client->contactdb()->lists()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all lists
+
+**This endpoint allows you to retrieve all of your recipient lists. If you don't have any lists, an empty array will be returned.**
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+### GET /contactdb/lists
+
+
+```php
+$response = $sg->client->contactdb()->lists()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete Multiple lists
+
+**This endpoint allows you to delete multiple recipient lists.**
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+### DELETE /contactdb/lists
+
+
+```php
+$request_body = json_decode('[
+ 1,
+ 2,
+ 3,
+ 4
+]');
+$response = $sg->client->contactdb()->lists()->delete($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update a List
+
+**This endpoint allows you to update the name of one of your recipient lists.**
+
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+### PATCH /contactdb/lists/{list_id}
+
+
+```php
+$request_body = json_decode('{
+ "name": "newlistname"
+}');
+$query_params = json_decode('{"list_id": 1}');
+$list_id = "test_url_param";
+$response = $sg->client->contactdb()->lists()->_($list_id)->patch($request_body, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a single list
+
+This endpoint allows you to retrieve a single recipient list.
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+### GET /contactdb/lists/{list_id}
+
+
+```php
+$query_params = json_decode('{"list_id": 1}');
+$list_id = "test_url_param";
+$response = $sg->client->contactdb()->lists()->_($list_id)->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a List
+
+**This endpoint allows you to delete a specific recipient list with the given ID.**
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+### DELETE /contactdb/lists/{list_id}
+
+
+```php
+$query_params = json_decode('{"delete_contacts": "true"}');
+$list_id = "test_url_param";
+$response = $sg->client->contactdb()->lists()->_($list_id)->delete(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Add Multiple Recipients to a List
+
+**This endpoint allows you to add multiple recipients to a list.**
+
+Adds existing recipients to a list, passing in the recipient IDs to add. Recipient IDs should be passed exactly as they are returned from recipient endpoints.
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+### POST /contactdb/lists/{list_id}/recipients
+
+
+```php
+$request_body = json_decode('[
+ "recipient_id1",
+ "recipient_id2"
+]');
+$list_id = "test_url_param";
+$response = $sg->client->contactdb()->lists()->_($list_id)->recipients()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all recipients on a List
+
+**This endpoint allows you to retrieve all recipients on the list with the given ID.**
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+### GET /contactdb/lists/{list_id}/recipients
+
+
+```php
+$query_params = json_decode('{"page": 1, "page_size": 1}');
+$list_id = "test_url_param";
+$response = $sg->client->contactdb()->lists()->_($list_id)->recipients()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Add a Single Recipient to a List
+
+**This endpoint allows you to add a single recipient to a list.**
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+### POST /contactdb/lists/{list_id}/recipients/{recipient_id}
+
+
+```php
+$list_id = "test_url_param";
+$recipient_id = "test_url_param";
+$response = $sg->client->contactdb()->lists()->_($list_id)->recipients()->_($recipient_id)->post();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a Single Recipient from a Single List
+
+**This endpoint allows you to delete a single recipient from a list.**
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+### DELETE /contactdb/lists/{list_id}/recipients/{recipient_id}
+
+
+```php
+$query_params = json_decode('{"recipient_id": 1, "list_id": 1}');
+$list_id = "test_url_param";
+$recipient_id = "test_url_param";
+$response = $sg->client->contactdb()->lists()->_($list_id)->recipients()->_($recipient_id)->delete(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update Recipient
+
+**This endpoint allows you to update one or more recipients.**
+
+The body of an API call to this endpoint must include an array of one or more recipient objects.
+
+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.
+
+The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
+
+### PATCH /contactdb/recipients
+
+
+```php
+$request_body = json_decode('[
+ {
+ "email": "jones@example.com",
+ "first_name": "Guy",
+ "last_name": "Jones"
+ }
+]');
+$response = $sg->client->contactdb()->recipients()->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Add recipients
+
+**This endpoint allows you to add a Marketing Campaigns recipient.**
+
+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.
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+### POST /contactdb/recipients
+
+
+```php
+$request_body = json_decode('[
+ {
+ "age": 25,
+ "email": "example@example.com",
+ "first_name": "",
+ "last_name": "User"
+ },
+ {
+ "age": 25,
+ "email": "example2@example.com",
+ "first_name": "Example",
+ "last_name": "User"
+ }
+]');
+$response = $sg->client->contactdb()->recipients()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve recipients
+
+**This endpoint allows you to retrieve all of your Marketing Campaigns recipients.**
+
+Batch deletion of a page makes it possible to receive an empty page of recipients before reaching the end of
+the list of recipients. To avoid this issue; iterate over pages until a 404 is retrieved.
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+### GET /contactdb/recipients
+
+
+```php
+$query_params = json_decode('{"page": 1, "page_size": 1}');
+$response = $sg->client->contactdb()->recipients()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete Recipient
+
+**This endpoint allows you to delete one or more recipients.**
+
+The body of an API call to this endpoint must include an array of recipient IDs of the recipients you want to delete.
+
+The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
+
+### DELETE /contactdb/recipients
+
+
+```php
+$request_body = json_decode('[
+ "recipient_id1",
+ "recipient_id2"
+]');
+$response = $sg->client->contactdb()->recipients()->delete($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve the count of billable recipients
+
+**This endpoint allows you to retrieve the number of Marketing Campaigns recipients that you will be billed for.**
+
+You are billed for marketing campaigns based on the highest number of recipients you have had in your account at one time. This endpoint will allow you to know the current billable count value.
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+### GET /contactdb/recipients/billable_count
+
+
+```php
+$response = $sg->client->contactdb()->recipients()->billable_count()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a Count of Recipients
+
+**This endpoint allows you to retrieve the total number of Marketing Campaigns recipients.**
+
+The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
+
+### GET /contactdb/recipients/count
+
+
+```php
+$response = $sg->client->contactdb()->recipients()->count()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve recipients matching search criteria
+
+**This endpoint allows you to perform a search on all of your Marketing Campaigns recipients.**
+
+field_name:
+
+* is a variable that is substituted for your actual custom field name from your recipient.
+* Text fields must be url-encoded. Date fields are searchable only by UNIX timestamp (e.g. 2/2/2015 becomes 1422835200)
+* If field_name is a 'reserved' date field, such as created_at or updated_at, the system will internally convert
+your epoch time to a date range encompassing the entire day. For example, an epoch time of 1422835600 converts to
+Mon, 02 Feb 2015 00:06:40 GMT, but internally the system will search from Mon, 02 Feb 2015 00:00:00 GMT through
+Mon, 02 Feb 2015 23:59:59 GMT.
+
+The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
+
+### GET /contactdb/recipients/search
+
+
+```php
+$query_params = json_decode('{"{field_name}": "test_string"}');
+$response = $sg->client->contactdb()->recipients()->search()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve recipients matching search criteria using segment conditions
+
+**This endpoint allows you to perform a search using segment conditions on all of your Marketing Campaigns recipients.**
+
+Valid operators for search depend on the type of the field you are segmenting:
+
+* **Dates:**
+ * "eq", "ne", "lt" (before), "gt" (after)
+ * You may use MM/DD/YYYY for day granularity or an epoch for second granularity.
+ * "empty", "not_empty"
+ * "is within"
+ * You may use an ISO 8601 date format or the # of days.
+* **Text:** "contains", "eq" (is - matches the full field), "ne" (is not - matches any field where the entire field is not the condition value), "empty", "not_empty"
+* **Numbers:** "eq", "lt", "gt", "empty", "not_empty"
+* **Email Clicks and Opens:** "eq" (opened), "ne" (not opened)
+
+Field values must all be a string.
+
+Search conditions using "eq" or "ne" for email clicks and opens should provide a "field" of either *clicks.campaign_identifier* or *opens.campaign_identifier*. The condition value should be a string containing the id of a completed campaign.
+
+Search conditions list may contain multiple conditions, joined by an "and" or "or" in the "and_or" field. The first condition in the conditions list must have an empty "and_or", and subsequent conditions must all specify an "and_or".
+
+The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
+
+### POST /contactdb/recipients/search
+
+
+```php
+$query_params = json_decode('{"page": 1, "page_size": 1}');
+$request_body = json_decode('{
+ "conditions": [
+ {
+ "and_or": "",
+ "field": "last_name",
+ "operator": "eq",
+ "value": "Miller"
+ },
+ {
+ "and_or": "and",
+ "field": "last_clicked",
+ "operator": "gt",
+ "value": "01/02/2015"
+ },
+ {
+ "and_or": "or",
+ "field": "clicks.campaign_identifier",
+ "operator": "eq",
+ "value": "513"
+ }
+ ],
+}');
+$response = $sg->client->contactdb()->recipients()->search()->post($request_body, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a single recipient
+
+**This endpoint allows you to retrieve a single recipient by ID from your contact database.**
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+### GET /contactdb/recipients/{recipient_id}
+
+
+```php
+$recipient_id = "test_url_param";
+$response = $sg->client->contactdb()->recipients()->_($recipient_id)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a Recipient
+
+**This endpoint allows you to delete a single recipient with the given ID from your contact database.**
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+### DELETE /contactdb/recipients/{recipient_id}
+
+
+```php
+$recipient_id = "test_url_param";
+$response = $sg->client->contactdb()->recipients()->_($recipient_id)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve the lists that a recipient is on
+
+**This endpoint allows you to retrieve the lists that a given recipient belongs to.**
+
+Each recipient can be on many lists. This endpoint gives you all of the lists that any one recipient has been added to.
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+### GET /contactdb/recipients/{recipient_id}/lists
+
+
+```php
+$recipient_id = "test_url_param";
+$response = $sg->client->contactdb()->recipients()->_($recipient_id)->lists()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve reserved fields
+
+**This endpoint allows you to list all fields that are reserved and can't be used for custom field names.**
+
+The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
+
+### GET /contactdb/reserved_fields
+
+
+```php
+$response = $sg->client->contactdb()->reserved_fields()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Create a Segment
+
+**This endpoint allows you to create a segment.**
+
+All recipients in your contactdb will be added or removed automatically depending on whether they match the criteria for this segment.
+
+List Id:
+
+* Send this to segment from an existing list
+* Don't send this in order to segment from your entire contactdb.
+
+Valid operators for create and update depend on the type of the field you are segmenting:
+
+* **Dates:**
+ * "eq", "ne", "lt" (before), "gt" (after)
+ * You may use MM/DD/YYYY for day granularity or an epoch for second granularity.
+ * "empty", "not_empty"
+ * "is within"
+ * You may use an ISO 8601 date format or the # of days.
+* **Text:** "contains", "eq" (is - matches the full field), "ne" (is not - matches any field where the entire field is not the condition value), "empty", "not_empty"
+* **Numbers:** "eq", "lt", "gt", "empty", "not_empty"
+* **Email Clicks and Opens:** "eq" (opened), "ne" (not opened)
+
+Field values must all be a string.
+
+Segment conditions using "eq" or "ne" for email clicks and opens should provide a "field" of either *clicks.campaign_identifier* or *opens.campaign_identifier*. The condition value should be a string containing the id of a completed campaign.
+
+Segments may contain multiple conditions, joined by an "and" or "or" in the "and_or" field. The first condition in the conditions list must have an empty "and_or", and subsequent conditions must all specify an "and_or".
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+For more information about segments in Marketing Campaigns, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/lists.html#-Create-a-Segment).
+
+### POST /contactdb/segments
+
+
+```php
+$request_body = json_decode('{
+ "conditions": [
+ {
+ "and_or": "",
+ "field": "last_name",
+ "operator": "eq",
+ "value": "Miller"
+ },
+ {
+ "and_or": "and",
+ "field": "last_clicked",
+ "operator": "gt",
+ "value": "01/02/2015"
+ },
+ {
+ "and_or": "or",
+ "field": "clicks.campaign_identifier",
+ "operator": "eq",
+ "value": "513"
+ }
+ ],
+ "list_id": 4,
+ "name": "Last Name Miller"
+}');
+$response = $sg->client->contactdb()->segments()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all segments
+
+**This endpoint allows you to retrieve all of your segments.**
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+For more information about segments in Marketing Campaigns, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/lists.html#-Create-a-Segment).
+
+### GET /contactdb/segments
+
+
+```php
+$response = $sg->client->contactdb()->segments()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update a segment
+
+**This endpoint allows you to update a segment.**
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+For more information about segments in Marketing Campaigns, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/lists.html#-Create-a-Segment).
+
+### PATCH /contactdb/segments/{segment_id}
+
+
+```php
+$request_body = json_decode('{
+ "conditions": [
+ {
+ "and_or": "",
+ "field": "last_name",
+ "operator": "eq",
+ "value": "Miller"
+ }
+ ],
+ "list_id": 5,
+ "name": "The Millers"
+}');
+$query_params = json_decode('{"segment_id": "test_string"}');
+$segment_id = "test_url_param";
+$response = $sg->client->contactdb()->segments()->_($segment_id)->patch($request_body, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a segment
+
+**This endpoint allows you to retrieve a single segment with the given ID.**
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+For more information about segments in Marketing Campaigns, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/lists.html#-Create-a-Segment).
+
+### GET /contactdb/segments/{segment_id}
+
+
+```php
+$query_params = json_decode('{"segment_id": 1}');
+$segment_id = "test_url_param";
+$response = $sg->client->contactdb()->segments()->_($segment_id)->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a segment
+
+**This endpoint allows you to delete a segment from your recipients database.**
+
+You also have the option to delete all the contacts from your Marketing Campaigns recipient database who were in this segment.
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+For more information about segments in Marketing Campaigns, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/lists.html#-Create-a-Segment).
+
+### DELETE /contactdb/segments/{segment_id}
+
+
+```php
+$query_params = json_decode('{"delete_contacts": "true"}');
+$segment_id = "test_url_param";
+$response = $sg->client->contactdb()->segments()->_($segment_id)->delete(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve recipients on a segment
+
+**This endpoint allows you to retrieve all of the recipients in a segment with the given ID.**
+
+The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
+
+For more information about segments in Marketing Campaigns, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/lists.html#-Create-a-Segment).
+
+### GET /contactdb/segments/{segment_id}/recipients
+
+
+```php
+$query_params = json_decode('{"page": 1, "page_size": 1}');
+$segment_id = "test_url_param";
+$response = $sg->client->contactdb()->segments()->_($segment_id)->recipients()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# DEVICES
+
+## Retrieve email statistics by device type.
+
+**This endpoint allows you to retrieve your email statistics segmented by the device type.**
+
+**We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints.
+
+## Available Device Types
+| **Device** | **Description** | **Example** |
+|---|---|---|
+| Desktop | Email software on a desktop computer. | I.E., Outlook, Sparrow, or Apple Mail. |
+| Webmail | A web-based email client. | I.E., Yahoo, Google, AOL, or Outlook.com. |
+| Phone | A smartphone. | iPhone, Android, Blackberry, etc.
+| Tablet | A tablet computer. | iPad, Android based tablet, etc. |
+| Other | An unrecognized device. |
+
+Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/index.html).
+
+### GET /devices/stats
+
+
+```php
+$query_params = json_decode('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}');
+$response = $sg->client->devices()->stats()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+
+# EMAIL ACTIVITY
+
+## Getting Started With the Email Activity Feed API
+
+**This endpoint allows you to query your messages.**
+
+Email Activity Feed allows you to search and download a CSV of your recent email event activity. For more information on how to get started, please see our [Getting Started Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Tutorials/getting_started_email_activity_api.html).
+
+
+# GEO
+
+## Retrieve email statistics by country and state/province.
+
+**This endpoint allows you to retrieve your email statistics segmented by country and state/province.**
+
+**We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints.
+
+Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/index.html).
+
+### GET /geo/stats
+
+
+```php
+$query_params = json_decode('{"end_date": "2016-04-01", "country": "US", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01"}');
+$response = $sg->client->geo()->stats()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# IPS
+
+## Retrieve all IP addresses
+
+**This endpoint allows you to retrieve a list of all assigned and unassigned IPs.**
+
+The response includes warm-up status, pools, assigned subusers, and authentication info. The start_date field corresponds to when warmup started for that IP.
+
+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.
+
+### GET /ips
+
+
+```php
+$query_params = json_decode('{"subuser": "test_string", "ip": "test_string", "limit": 1, "exclude_whitelabels": "true", "offset": 1}');
+$response = $sg->client->ips()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all assigned IPs
+
+**This endpoint allows you to retrieve only assigned IP addresses.**
+
+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.
+
+### GET /ips/assigned
+
+
+```php
+$response = $sg->client->ips()->assigned()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Create an IP pool.
+
+**This endpoint allows you to create an IP pool.**
+
+**Each user can create up to 10 different IP pools.**
+
+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.
+
+IP pools can only be used with authenticated IP addresses.
+
+If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.
+
+### POST /ips/pools
+
+
+```php
+$request_body = json_decode('{
+ "name": "marketing"
+}');
+$response = $sg->client->ips()->pools()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all IP pools.
+
+**This endpoint allows you to retrieve all of your IP pools.**
+
+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.
+
+IP pools can only be used with authenticated IP addresses.
+
+If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.
+
+### GET /ips/pools
+
+
+```php
+$response = $sg->client->ips()->pools()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update an IP pools name.
+
+**This endpoint allows you to update the name of an IP pool.**
+
+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.
+
+IP pools can only be used with authenticated IP addresses.
+
+If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.
+
+### PUT /ips/pools/{pool_name}
+
+
+```php
+$request_body = json_decode('{
+ "name": "new_pool_name"
+}');
+$pool_name = "test_url_param";
+$response = $sg->client->ips()->pools()->_($pool_name)->put($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all IPs in a specified pool.
+
+**This endpoint allows you to list all of the IP addresses that are in a specific IP pool.**
+
+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.
+
+IP pools can only be used with authenticated IP addresses.
+
+If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.
+
+### GET /ips/pools/{pool_name}
+
+
+```php
+$pool_name = "test_url_param";
+$response = $sg->client->ips()->pools()->_($pool_name)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete an IP pool.
+
+**This endpoint allows you to delete an IP pool.**
+
+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.
+
+IP pools can only be used with authenticated IP addresses.
+
+If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.
+
+### DELETE /ips/pools/{pool_name}
+
+
+```php
+$pool_name = "test_url_param";
+$response = $sg->client->ips()->pools()->_($pool_name)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Add an IP address to a pool
+
+**This endpoint allows you to add an IP address to an IP pool.**
+
+You can add the same IP address to multiple pools. It may take up to 60 seconds for your IP address to be added to a pool after your request is made.
+
+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.
+
+### POST /ips/pools/{pool_name}/ips
+
+
+```php
+$request_body = json_decode('{
+ "ip": "0.0.0.0"
+}');
+$pool_name = "test_url_param";
+$response = $sg->client->ips()->pools()->_($pool_name)->ips()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Remove an IP address from a pool.
+
+**This endpoint allows you to remove an IP address from an IP pool.**
+
+The same IP address can be added to multiple IP pools.
+
+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.
+
+### DELETE /ips/pools/{pool_name}/ips/{ip}
+
+
+```php
+$pool_name = "test_url_param";
+$ip = "test_url_param";
+$response = $sg->client->ips()->pools()->_($pool_name)->ips()->_($ip)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Add an IP to warmup
+
+**This endpoint allows you to enter an IP address into warmup mode.**
+
+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.
+
+For more general information about warming up IPs, please see our [Classroom](https://sendgrid.com/docs/Classroom/Deliver/Delivery_Introduction/warming_up_ips.html).
+
+### POST /ips/warmup
+
+
+```php
+$request_body = json_decode('{
+ "ip": "0.0.0.0"
+}');
+$response = $sg->client->ips()->warmup()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all IPs currently in warmup
+
+**This endpoint allows you to retrieve all of your IP addresses that are currently warming up.**
+
+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.
+
+For more general information about warming up IPs, please see our [Classroom](https://sendgrid.com/docs/Classroom/Deliver/Delivery_Introduction/warming_up_ips.html).
+
+### GET /ips/warmup
+
+
+```php
+$response = $sg->client->ips()->warmup()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve warmup status for a specific IP address
+
+**This endpoint allows you to retrieve the warmup status for a specific IP address.**
+
+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.
+
+For more general information about warming up IPs, please see our [Classroom](https://sendgrid.com/docs/Classroom/Deliver/Delivery_Introduction/warming_up_ips.html).
+
+### GET /ips/warmup/{ip_address}
+
+
+```php
+$ip_address = "test_url_param";
+$response = $sg->client->ips()->warmup()->_($ip_address)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Remove an IP from warmup
+
+**This endpoint allows you to remove an IP address from warmup mode.**
+
+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.
+
+For more general information about warming up IPs, please see our [Classroom](https://sendgrid.com/docs/Classroom/Deliver/Delivery_Introduction/warming_up_ips.html).
+
+### DELETE /ips/warmup/{ip_address}
+
+
+```php
+$ip_address = "test_url_param";
+$response = $sg->client->ips()->warmup()->_($ip_address)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all IP pools an IP address belongs to
+
+**This endpoint allows you to see which IP pools a particular IP address has been added to.**
+
+The same IP address can be added to multiple IP pools.
+
+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.
+
+### GET /ips/{ip_address}
+
+
+```php
+$ip_address = "test_url_param";
+$response = $sg->client->ips()->_($ip_address)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# MAIL
+
+## Create a batch ID
+
+**This endpoint allows you to generate a new batch ID. This batch ID can be associated with scheduled sends via the mail/send endpoint.**
+
+If you set the SMTPAPI header `batch_id`, it allows you to then associate multiple scheduled mail/send requests together with the same ID. Then at anytime up to 10 minutes before the scheduled date, you can cancel all of the mail/send requests that have this batch ID by calling the Cancel Scheduled Send endpoint.
+
+More Information:
+
+* [Scheduling Parameters > Batch ID](https://sendgrid.com/docs/API_Reference/SMTP_API/scheduling_parameters.html)
+
+### POST /mail/batch
+
+
+```php
+$response = $sg->client->mail()->batch()->post();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Validate batch ID
+
+**This endpoint allows you to validate a batch ID.**
+
+If you set the SMTPAPI header `batch_id`, it allows you to then associate multiple scheduled mail/send requests together with the same ID. Then at anytime up to 10 minutes before the scheduled date, you can cancel all of the mail/send requests that have this batch ID by calling the Cancel Scheduled Send endpoint.
+
+More Information:
+
+* [Scheduling Parameters > Batch ID](https://sendgrid.com/docs/API_Reference/SMTP_API/scheduling_parameters.html)
+
+### GET /mail/batch/{batch_id}
+
+
+```php
+$batch_id = "test_url_param";
+$response = $sg->client->mail()->batch()->_($batch_id)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## v3 Mail Send
+
+This endpoint allows you to send the 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).
+
+* Top level parameters are referred to as "global".
+* Individual fields within the personalizations array will override any other global, or message level, parameters that are defined outside of personalizations.
+
+* Note: bypass_bounce_management, bypass_spam_management, and bypass_unsubscribe_management cannot
+* be combined with bypass_list_management
+
+For an overview of the v3 Mail Send endpoint, please visit our [v3 API Reference](https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/index.html)
+
+For more detailed information about how to use the v3 Mail Send endpoint, please visit our [Classroom](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/index.html).
+
+### POST /mail/send
+
+This endpoint has a helper, check it out [here](lib/helpers/mail/README.md).
+
+```php
+$request_body = json_decode('{
+ "asm": {
+ "group_id": 1,
+ "groups_to_display": [
+ 1,
+ 2,
+ 3
+ ]
+ },
+ "attachments": [
+ {
+ "content": "[BASE64 encoded content block here]",
+ "content_id": "ii_139db99fdb5c3704",
+ "disposition": "inline",
+ "filename": "file1.jpg",
+ "name": "file1",
+ "type": "jpg"
+ }
+ ],
+ "batch_id": "[YOUR BATCH ID GOES HERE]",
+ "categories": [
+ "category1",
+ "category2"
+ ],
+ "content": [
+ {
+ "type": "text/html",
+ "value": "Hello, world!
"
+ }
+ ],
+ "custom_args": {
+ "New Argument 1": "New Value 1",
+ "activationAttempt": "1",
+ "customerAccountNumber": "[CUSTOMER ACCOUNT NUMBER GOES HERE]"
+ },
+ "from": {
+ "email": "sam.smith@example.com",
+ "name": "Sam Smith"
+ },
+ "headers": {},
+ "ip_pool_name": "[YOUR POOL NAME GOES HERE]",
+ "mail_settings": {
+ "bcc": {
+ "email": "ben.doe@example.com",
+ "enable": true
+ },
+ "bypass_bounce_management": {
+ "enable": true
+ },
+ "bypass_list_management": {
+ "enable": true
+ },
+ "bypass_spam_management": {
+ "enable": true
+ },
+ "bypass_unsubscribe_management": {
+ "enable": true
+ },
+
+ "footer": {
+ "enable": true,
+ "html": "ThanksThe Twilio SendGrid Team
",
+ "text": "Thanks,/n The Twilio SendGrid Team"
+ },
+ "sandbox_mode": {
+ "enable": false
+ },
+ "spam_check": {
+ "enable": true,
+ "post_to_url": "http://example.com/compliance",
+ "threshold": 3
+ }
+ },
+ "personalizations": [
+ {
+ "bcc": [
+ {
+ "email": "sam.doe@example.com",
+ "name": "Sam Doe"
+ }
+ ],
+ "cc": [
+ {
+ "email": "jane.doe@example.com",
+ "name": "Jane Doe"
+ }
+ ],
+ "custom_args": {
+ "New Argument 1": "New Value 1",
+ "activationAttempt": "1",
+ "customerAccountNumber": "[CUSTOMER ACCOUNT NUMBER GOES HERE]"
+ },
+ "headers": {
+ "X-Accept-Language": "en",
+ "X-Mailer": "MyApp"
+ },
+ "send_at": 1409348513,
+ "subject": "Hello, World!",
+ "substitutions": {
+ "id": "substitutions",
+ "type": "object"
+ },
+ "to": [
+ {
+ "email": "john.doe@example.com",
+ "name": "John Doe"
+ }
+ ]
+ }
+ ],
+ "reply_to": {
+ "email": "sam.smith@example.com",
+ "name": "Sam Smith"
+ },
+ "sections": {
+ "section": {
+ ":sectionName1": "section 1 text",
+ ":sectionName2": "section 2 text"
+ }
+ },
+ "send_at": 1409348513,
+ "subject": "Hello, World!",
+ "template_id": "[YOUR TEMPLATE ID GOES HERE]",
+ "tracking_settings": {
+ "click_tracking": {
+ "enable": true,
+ "enable_text": true
+ },
+ "ganalytics": {
+ "enable": true,
+ "utm_campaign": "[NAME OF YOUR REFERRER SOURCE]",
+ "utm_content": "[USE THIS SPACE TO DIFFERENTIATE YOUR EMAIL FROM ADS]",
+ "utm_medium": "[NAME OF YOUR MARKETING MEDIUM e.g. email]",
+ "utm_name": "[NAME OF YOUR CAMPAIGN]",
+ "utm_term": "[IDENTIFY PAID KEYWORDS HERE]"
+ },
+ "open_tracking": {
+ "enable": true,
+ "substitution_tag": "%opentrack"
+ },
+ "subscription_tracking": {
+ "enable": true,
+ "html": "If you would like to unsubscribe and stop receiving these emails <% clickhere %>.",
+ "substitution_tag": "<%click here%>",
+ "text": "If you would like to unsubscribe and stop receiving these emails <% click here %>."
+ }
+ }
+}');
+$response = $sg->client->mail()->send()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# MAIL SETTINGS
+
+## Retrieve all mail settings
+
+**This endpoint allows you to retrieve a list of all mail settings.**
+
+Mail settings allow you to tell Twilio 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).
+
+### GET /mail_settings
+
+
+```php
+$query_params = json_decode('{"limit": 1, "offset": 1}');
+$response = $sg->client->mail_settings()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update address whitelist mail settings
+
+**This endpoint allows you to update your current email address whitelist settings.**
+
+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.
+
+Mail settings allow you to tell Twilio 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).
+
+### PATCH /mail_settings/address_whitelist
+
+
+```php
+$request_body = json_decode('{
+ "enabled": true,
+ "list": [
+ "email1@example.com",
+ "example.com"
+ ]
+}');
+$response = $sg->client->mail_settings()->address_whitelist()->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve address whitelist mail settings
+
+**This endpoint allows you to retrieve your current email address whitelist settings.**
+
+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.
+
+Mail settings allow you to tell Twilio 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).
+
+### GET /mail_settings/address_whitelist
+
+
+```php
+$response = $sg->client->mail_settings()->address_whitelist()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update BCC mail settings
+
+**This endpoint allows you to update your current BCC mail settings.**
+
+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.
+
+Mail settings allow you to tell Twilio 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).
+
+### PATCH /mail_settings/bcc
+
+
+```php
+$request_body = json_decode('{
+ "email": "email@example.com",
+ "enabled": false
+}');
+$response = $sg->client->mail_settings()->bcc()->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all BCC mail settings
+
+**This endpoint allows you to retrieve your current BCC mail settings.**
+
+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.
+
+Mail settings allow you to tell Twilio 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).
+
+### GET /mail_settings/bcc
+
+
+```php
+$response = $sg->client->mail_settings()->bcc()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update bounce purge mail settings
+
+**This endpoint allows you to update your current bounce purge settings.**
+
+This setting allows you to set a schedule for Twilio SendGrid to automatically delete contacts from your soft and hard bounce suppression lists.
+
+Mail settings allow you to tell Twilio 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).
+
+### PATCH /mail_settings/bounce_purge
+
+
+```php
+$request_body = json_decode('{
+ "enabled": true,
+ "hard_bounces": 5,
+ "soft_bounces": 5
+}');
+$response = $sg->client->mail_settings()->bounce_purge()->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve bounce purge mail settings
+
+**This endpoint allows you to retrieve your current bounce purge settings.**
+
+This setting allows you to set a schedule for Twilio SendGrid to automatically delete contacts from your soft and hard bounce suppression lists.
+
+Mail settings allow you to tell Twilio 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).
+
+### GET /mail_settings/bounce_purge
+
+
+```php
+$response = $sg->client->mail_settings()->bounce_purge()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update footer mail settings
+
+**This endpoint allows you to update your current Footer mail settings.**
+
+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.
+
+Mail settings allow you to tell Twilio 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).
+
+### PATCH /mail_settings/footer
+
+
+```php
+$request_body = json_decode('{
+ "enabled": true,
+ "html_content": "...",
+ "plain_content": "..."
+}');
+$response = $sg->client->mail_settings()->footer()->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve footer mail settings
+
+**This endpoint allows you to retrieve your current Footer mail settings.**
+
+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.
+
+Mail settings allow you to tell Twilio 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).
+
+### GET /mail_settings/footer
+
+
+```php
+$response = $sg->client->mail_settings()->footer()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update forward bounce mail settings
+
+**This endpoint allows you to update your current bounce forwarding mail settings.**
+
+Activating this setting allows you to specify an email address to which bounce reports are forwarded.
+
+Mail settings allow you to tell Twilio 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).
+
+### PATCH /mail_settings/forward_bounce
+
+
+```php
+$request_body = json_decode('{
+ "email": "example@example.com",
+ "enabled": true
+}');
+$response = $sg->client->mail_settings()->forward_bounce()->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve forward bounce mail settings
+
+**This endpoint allows you to retrieve your current bounce forwarding mail settings.**
+
+Activating this setting allows you to specify an email address to which bounce reports are forwarded.
+
+Mail settings allow you to tell Twilio 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).
+
+### GET /mail_settings/forward_bounce
+
+
+```php
+$response = $sg->client->mail_settings()->forward_bounce()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update forward spam mail settings
+
+**This endpoint allows you to update your current Forward Spam mail settings.**
+
+Enabling the forward spam setting allows you to specify an email address to which spam reports will be forwarded.
+
+Mail settings allow you to tell Twilio 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).
+
+### PATCH /mail_settings/forward_spam
+
+
+```php
+$request_body = json_decode('{
+ "email": "",
+ "enabled": false
+}');
+$response = $sg->client->mail_settings()->forward_spam()->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve forward spam mail settings
+
+**This endpoint allows you to retrieve your current Forward Spam mail settings.**
+
+Enabling the forward spam setting allows you to specify an email address to which spam reports will be forwarded.
+
+Mail settings allow you to tell Twilio 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).
+
+### GET /mail_settings/forward_spam
+
+
+```php
+$response = $sg->client->mail_settings()->forward_spam()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update plain content mail settings
+
+**This endpoint allows you to update your current Plain Content mail settings.**
+
+The plain content setting will automatically convert any plain text emails that you send to HTML before sending.
+
+Mail settings allow you to tell Twilio 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).
+
+### PATCH /mail_settings/plain_content
+
+
+```php
+$request_body = json_decode('{
+ "enabled": false
+}');
+$response = $sg->client->mail_settings()->plain_content()->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve plain content mail settings
+
+**This endpoint allows you to retrieve your current Plain Content mail settings.**
+
+The plain content setting will automatically convert any plain text emails that you send to HTML before sending.
+
+Mail settings allow you to tell Twilio Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio 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).
+
+### GET /mail_settings/plain_content
+
+
+```php
+$response = $sg->client->mail_settings()->plain_content()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update spam check mail settings
+
+**This endpoint allows you to update your current spam checker mail settings.**
+
+The spam checker filter notifies you when emails are detected that exceed a predefined spam threshold.
+
+Mail settings allow you to tell Twilio 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).
+
+### PATCH /mail_settings/spam_check
+
+
+```php
+$request_body = json_decode('{
+ "enabled": true,
+ "max_score": 5,
+ "url": "url"
+}');
+$response = $sg->client->mail_settings()->spam_check()->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve spam check mail settings
+
+**This endpoint allows you to retrieve your current Spam Checker mail settings.**
+
+The spam checker filter notifies you when emails are detected that exceed a predefined spam threshold.
+
+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).
+
+### GET /mail_settings/spam_check
+
+
+```php
+$response = $sg->client->mail_settings()->spam_check()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update template mail settings
+
+**This endpoint allows you to update your current legacy email template settings.**
+
+This setting refers to our original email templates. We currently support more fully featured [transactional templates](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
+
+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.
+
+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).
+
+### PATCH /mail_settings/template
+
+
+```php
+$request_body = json_decode('{
+ "enabled": true,
+ "html_content": "<% body %>"
+}');
+$response = $sg->client->mail_settings()->template()->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve legacy template mail settings
+
+**This endpoint allows you to retrieve your current legacy email template settings.**
+
+This setting refers to our original email templates. We currently support more fully featured [transactional templates](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
+
+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.
+
+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).
+
+### GET /mail_settings/template
+
+
+```php
+$response = $sg->client->mail_settings()->template()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# MAILBOX PROVIDERS
+
+## Retrieve email statistics by mailbox provider.
+
+**This endpoint allows you to retrieve your email statistics segmented by recipient mailbox provider.**
+
+**We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints.
+
+Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/index.html).
+
+### GET /mailbox_providers/stats
+
+
+```php
+$query_params = json_decode('{"end_date": "2016-04-01", "mailbox_providers": "test_string", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01"}');
+$response = $sg->client->mailbox_providers()->stats()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# PARTNER SETTINGS
+
+## Returns a list of all partner settings.
+
+**This endpoint allows you to retrieve a list of all partner settings that you can enable.**
+
+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).
+
+### GET /partner_settings
+
+
+```php
+$query_params = json_decode('{"limit": 1, "offset": 1}');
+$response = $sg->client->partner_settings()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Updates New Relic partner settings.
+
+**This endpoint allows you to update or change your New Relic partner settings.**
+
+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).
+
+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).
+
+### PATCH /partner_settings/new_relic
+
+
+```php
+$request_body = json_decode('{
+ "enable_subuser_statistics": true,
+ "enabled": true,
+ "license_key": ""
+}');
+$response = $sg->client->partner_settings()->new_relic()->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Returns all New Relic partner settings.
+
+**This endpoint allows you to retrieve your current New Relic partner settings.**
+
+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).
+
+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).
+
+### GET /partner_settings/new_relic
+
+
+```php
+$response = $sg->client->partner_settings()->new_relic()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# SCOPES
+
+## Retrieve a list of scopes for which this user has access.
+
+**This endpoint returns a list of all scopes that this user has access to.**
+
+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).
+
+### GET /scopes
+
+
+```php
+$response = $sg->client->scopes()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# SENDERS
+
+## Create a Sender Identity
+
+**This endpoint allows you to create a new sender identity.**
+
+*You may create up to 100 unique sender identities.*
+
+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`.
+
+### POST /senders
+
+
+```php
+$request_body = json_decode('{
+ "address": "123 Elm St.",
+ "address_2": "Apt. 456",
+ "city": "Denver",
+ "country": "United States",
+ "from": {
+ "email": "from@example.com",
+ "name": "Example INC"
+ },
+ "nickname": "My Sender ID",
+ "reply_to": {
+ "email": "replyto@example.com",
+ "name": "Example INC"
+ },
+ "state": "Colorado",
+ "zip": "80202"
+}');
+$response = $sg->client->senders()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Get all Sender Identities
+
+**This endpoint allows you to retrieve a list of all sender identities that have been created for your account.**
+
+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`.
+
+### GET /senders
+
+
+```php
+$response = $sg->client->senders()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update a Sender Identity
+
+**This endpoint allows you to update a sender identity.**
+
+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`.
+
+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.
+
+### PATCH /senders/{sender_id}
+
+
+```php
+$request_body = json_decode('{
+ "address": "123 Elm St.",
+ "address_2": "Apt. 456",
+ "city": "Denver",
+ "country": "United States",
+ "from": {
+ "email": "from@example.com",
+ "name": "Example INC"
+ },
+ "nickname": "My Sender ID",
+ "reply_to": {
+ "email": "replyto@example.com",
+ "name": "Example INC"
+ },
+ "state": "Colorado",
+ "zip": "80202"
+}');
+$sender_id = "test_url_param";
+$response = $sg->client->senders()->_($sender_id)->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## View a Sender Identity
+
+**This endpoint allows you to retrieve a specific sender identity.**
+
+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`.
+
+### GET /senders/{sender_id}
+
+
+```php
+$sender_id = "test_url_param";
+$response = $sg->client->senders()->_($sender_id)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a Sender Identity
+
+**This endpoint allows you to delete one of your sender identities.**
+
+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`.
+
+### DELETE /senders/{sender_id}
+
+
+```php
+$sender_id = "test_url_param";
+$response = $sg->client->senders()->_($sender_id)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Resend Sender Identity Verification
+
+**This endpoint allows you to resend a sender identity verification email.**
+
+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`.
+
+### POST /senders/{sender_id}/resend_verification
+
+
+```php
+$sender_id = "test_url_param";
+$response = $sg->client->senders()->_($sender_id)->resend_verification()->post();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# SENDER AUTHENTICATION
+
+## Create an authenticated domain.
+
+**This endpoint allows you to create a domain authentication for one of your domains.**
+
+If you are creating a domain authentication that you would like a subuser to use, you have two options:
+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.
+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.
+
+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.
+
+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/)
+
+### POST /whitelabel/domains
+
+
+```php
+$request_body = json_decode('{
+ "automatic_security": false,
+ "custom_spf": true,
+ "default": true,
+ "domain": "example.com",
+ "ips": [
+ "192.168.1.1",
+ "192.168.1.2"
+ ],
+ "subdomain": "news",
+ "username": "john@example.com"
+}');
+$response = $sg->client->whitelabel()->domains()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## List all domain authentications.
+
+**This endpoint allows you to retrieve a list of all domain authentications you have created.**
+
+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.
+
+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/)
+
+### GET /whitelabel/domains
+
+
+```php
+$query_params = json_decode('{"username": "test_string", "domain": "test_string", "exclude_subusers": "true", "limit": 1, "offset": 1}');
+$response = $sg->client->whitelabel()->domains()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Get the default domain authentication.
+
+**This endpoint allows you to retrieve the default authentication for a domain.**
+
+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.
+
+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/)
+
+## URI Parameters
+| URI Parameter | Type | Description |
+|---|---|---|
+| domain | string |The domain to find a default domain whitelabel for. |
+
+### GET /whitelabel/domains/default
+
+
+```php
+$response = $sg->client->whitelabel()->domains()->default()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## List the domain authentication associated with the given user.
+
+**This endpoint allows you to retrieve all of the domain authentications that have been assigned to a specific subuser.**
+
+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 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.
+
+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.
+
+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/)
+
+## URI Parameters
+| URI Parameter | Type | Description |
+|---|---|---|
+| username | string | Username of the subuser to find associated whitelabels for. |
+
+### GET /whitelabel/domains/subuser
+
+
+```php
+$response = $sg->client->whitelabel()->domains()->subuser()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Disassociate a domain authentication from a given user.
+
+**This endpoint allows you to disassociate a specific domain authentication from a subuser.**
+
+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.
+
+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.
+
+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/)
+
+## URI Parameters
+| URI Parameter | Type | Required? | Description |
+|---|---|---|---|
+| username | string | required | Username for the subuser to find associated whitelabels for. |
+
+### DELETE /whitelabel/domains/subuser
+
+
+```php
+$response = $sg->client->whitelabel()->domains()->subuser()->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update a domain authentication.
+
+**This endpoint allows you to update the settings for a domain authentication.**
+
+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.
+
+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/)
+
+### PATCH /whitelabel/domains/{domain_id}
+
+
+```php
+$request_body = json_decode('{
+ "custom_spf": true,
+ "default": false
+}');
+$domain_id = "test_url_param";
+$response = $sg->client->whitelabel()->domains()->_($domain_id)->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a domain authentication.
+
+**This endpoint allows you to retrieve a specific domain authentication.**
+
+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.
+
+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/)
+
+
+### GET /whitelabel/domains/{domain_id}
+
+
+```php
+$domain_id = "test_url_param";
+$response = $sg->client->whitelabel()->domains()->_($domain_id)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a domain authentication.
+
+**This endpoint allows you to delete a domain authentication.**
+
+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.
+
+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/)
+
+### DELETE /whitelabel/domains/{domain_id}
+
+
+```php
+$domain_id = "test_url_param";
+$response = $sg->client->whitelabel()->domains()->_($domain_id)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Associate a domain authentication with a given user.
+
+**This endpoint allows you to associate a specific domain authentication with a subuser.**
+
+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.
+
+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.
+
+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/)
+
+## URI Parameters
+| URI Parameter | Type | Description |
+|---|---|---|
+| domain_id | integer | ID of the domain whitelabel to associate with the subuser. |
+
+### POST /whitelabel/domains/{domain_id}/subuser
+
+
+```php
+$request_body = json_decode('{
+ "username": "jane@example.com"
+}');
+$domain_id = "test_url_param";
+$response = $sg->client->whitelabel()->domains()->_($domain_id)->subuser()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Add an IP to a domain authentication.
+
+**This endpoint allows you to add an IP address to a domain authentication.**
+
+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.
+
+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/)
+
+## URI Parameters
+| URI Parameter | Type | Description |
+|---|---|---|
+| id | integer | ID of the domain to which you are adding an IP |
+
+### POST /whitelabel/domains/{id}/ips
+
+
+```php
+$request_body = json_decode('{
+ "ip": "192.168.0.1"
+}');
+$id = "test_url_param";
+$response = $sg->client->whitelabel()->domains()->_($id)->ips()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Remove an IP from a domain authentication.
+
+**This endpoint allows you to remove a domain's IP address from that domain's authentication.**
+
+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.
+
+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/)
+
+## URI Parameters
+| URI Parameter | Type | Description |
+|---|---|---|
+| id | integer | ID of the domain whitelabel to delete the IP from. |
+| ip | string | IP to remove from the domain whitelabel. |
+
+### DELETE /whitelabel/domains/{id}/ips/{ip}
+
+
+```php
+$id = "test_url_param";
+$ip = "test_url_param";
+$response = $sg->client->whitelabel()->domains()->_($id)->ips()->_($ip)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Validate a domain authentication.
+
+**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.**
+
+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.
+
+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/)
+
+## URI Parameters
+| URI Parameter | Type | Description |
+|---|---|---|
+| id | integer |ID of the domain whitelabel to validate. |
+
+### POST /whitelabel/domains/{id}/validate
+
+
+```php
+$id = "test_url_param";
+$response = $sg->client->whitelabel()->domains()->_($id)->validate()->post();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Create a reverse DNS record
+
+**This endpoint allows you to create a reverse DNS record.**
+
+When creating a reverse DNS record, you should use the same subdomain that you used when you created a domain authentication.
+
+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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/).
+
+### POST /whitelabel/ips
+
+
+```php
+$request_body = json_decode('{
+ "domain": "example.com",
+ "ip": "192.168.1.1",
+ "subdomain": "email"
+}');
+$response = $sg->client->whitelabel()->ips()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all reverse DNS records
+
+**This endpoint allows you to retrieve all of the reverse DNS records that have been created by this account.**
+
+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.").
+
+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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/).
+
+### GET /whitelabel/ips
+
+
+```php
+$query_params = json_decode('{"ip": "test_string", "limit": 1, "offset": 1}');
+$response = $sg->client->whitelabel()->ips()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve an reverse DNS record
+
+**This endpoint allows you to retrieve a reverse DNS record.**
+
+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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/).
+
+### GET /whitelabel/ips/{id}
+
+
+```php
+$id = "test_url_param";
+$response = $sg->client->whitelabel()->ips()->_($id)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete an reverse DNS record
+
+**This endpoint allows you to delete a reverse DNS record.**
+
+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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/).
+
+### DELETE /whitelabel/ips/{id}
+
+
+```php
+$id = "test_url_param";
+$response = $sg->client->whitelabel()->ips()->_($id)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Validate a reverse DNS record
+
+**This endpoint allows you to validate a reverse DNS record.**
+
+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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/).
+
+### POST /whitelabel/ips/{id}/validate
+
+
+```php
+$id = "test_url_param";
+$response = $sg->client->whitelabel()->ips()->_($id)->validate()->post();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Create a Branded Link
+
+**This endpoint allows you to create a new link branding.**
+
+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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
+
+### POST /whitelabel/links
+
+
+```php
+$request_body = json_decode('{
+ "default": true,
+ "domain": "example.com",
+ "subdomain": "mail"
+}');
+$query_params = json_decode('{"limit": 1, "offset": 1}');
+$response = $sg->client->whitelabel()->links()->post($request_body, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all link brandings
+
+**This endpoint allows you to retrieve all link brandings.**
+
+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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
+
+### GET /whitelabel/links
+
+
+```php
+$query_params = json_decode('{"limit": 1}');
+$response = $sg->client->whitelabel()->links()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a Default Link Branding
+
+**This endpoint allows you to retrieve the default link branding.**
+
+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:
+
+ - Validated link branding marked as "default"
+ - Legacy link brands (migrated from the whitelabel wizard)
+ - Default Twilio SendGrid link whitelabel (i.e. 100.ct.sendgrid.net)
+
+
+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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
+
+### GET /whitelabel/links/default
+
+
+```php
+$query_params = json_decode('{"domain": "test_string"}');
+$response = $sg->client->whitelabel()->links()->default()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve Associated Link Branding
+
+**This endpoint allows you to retrieve the associated link branding for a subuser.**
+
+Link branding can be associated with subusers from the parent account. This functionality allows
+subusers to send mail using their parent's link brands. To associate a link branding, the parent account
+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.
+
+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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
+
+### GET /whitelabel/links/subuser
+
+
+```php
+$query_params = json_decode('{"username": "test_string"}');
+$response = $sg->client->whitelabel()->links()->subuser()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Disassociate a Link Branding
+
+**This endpoint allows you to disassociate a link branding from a subuser.**
+
+Link branding can be associated with subusers from the parent account. This functionality allows
+subusers to send mail using their parent's link brands. To associate a link branding, the parent account
+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.
+
+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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
+
+### DELETE /whitelabel/links/subuser
+
+
+```php
+$query_params = json_decode('{"username": "test_string"}');
+$response = $sg->client->whitelabel()->links()->subuser()->delete(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update a Link Branding
+
+**This endpoint allows you to update a specific link branding. You can use this endpoint to change a branded link's default status.**
+
+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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
+
+### PATCH /whitelabel/links/{id}
+
+
+```php
+$request_body = json_decode('{
+ "default": true
+}');
+$id = "test_url_param";
+$response = $sg->client->whitelabel()->links()->_($id)->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a Link Branding
+
+**This endpoint allows you to retrieve a specific link branding.**
+
+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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
+
+### GET /whitelabel/links/{id}
+
+
+```php
+$id = "test_url_param";
+$response = $sg->client->whitelabel()->links()->_($id)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a Link Branding
+
+**This endpoint allows you to delete a link branding.**
+
+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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
+
+### DELETE /whitelabel/links/{id}
+
+
+```php
+$id = "test_url_param";
+$response = $sg->client->whitelabel()->links()->_($id)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Validate a Link Branding
+
+**This endpoint allows you to validate a link branding.**
+
+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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
+
+### POST /whitelabel/links/{id}/validate
+
+
+```php
+$id = "test_url_param";
+$response = $sg->client->whitelabel()->links()->_($id)->validate()->post();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Associate a Link Branding
+
+**This endpoint allows you to associate a link branding with a subuser account.**
+
+Link branding can be associated with subusers from the parent account. This functionality allows
+subusers to send mail using their parent's link brands. To associate a link branding, the parent account
+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.
+
+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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
+
+### POST /whitelabel/links/{link_id}/subuser
+
+
+```php
+$request_body = json_decode('{
+ "username": "jane@example.com"
+}');
+$link_id = "test_url_param";
+$response = $sg->client->whitelabel()->links()->_($link_id)->subuser()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+
+# STATS
+
+## Retrieve global email statistics
+
+**This endpoint allows you to retrieve all of your global email statistics between a given date range.**
+
+Parent accounts will see aggregated stats for their account and all subuser accounts. Subuser accounts will only see their own stats.
+
+### GET /stats
+
+
+```php
+$query_params = json_decode('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}');
+$response = $sg->client->stats()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# SUBUSERS
+
+## Create Subuser
+
+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.
+
+For more information about Subusers:
+
+* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)
+* [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)
+
+### POST /subusers
+
+
+```php
+$request_body = json_decode('{
+ "email": "John@example.com",
+ "ips": [
+ "1.1.1.1",
+ "2.2.2.2"
+ ],
+ "password": "johns_password",
+ "username": "John@example.com"
+}');
+$response = $sg->client->subusers()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## List all Subusers
+
+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.
+
+For more information about Subusers:
+
+* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)
+* [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)
+
+### GET /subusers
+
+
+```php
+$query_params = json_decode('{"username": "test_string", "limit": 1, "offset": 1}');
+$response = $sg->client->subusers()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve Subuser Reputations
+
+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.
+
+This endpoint allows you to request the reputations for your subusers.
+
+### GET /subusers/reputations
+
+
+```php
+$query_params = json_decode('{"usernames": "test_string"}');
+$response = $sg->client->subusers()->reputations()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve email statistics for your subusers.
+
+**This endpoint allows you to retrieve the email statistics for the given subusers.**
+
+You may retrieve statistics for up to 10 different subusers by including an additional _subusers_ parameter for each additional subuser.
+
+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.
+
+For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).
+
+### GET /subusers/stats
+
+
+```php
+$query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01", "subusers": "test_string"}');
+$response = $sg->client->subusers()->stats()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve monthly stats for all subusers
+
+**This endpoint allows you to retrieve the monthly email statistics for all subusers over the given date range.**
+
+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.
+
+When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics:
+`bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`.
+
+For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).
+
+### GET /subusers/stats/monthly
+
+
+```php
+$query_params = json_decode('{"subuser": "test_string", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "date": "test_string", "sort_by_direction": "asc"}');
+$response = $sg->client->subusers()->stats()->monthly()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve the totals for each email statistic metric for all subusers.
+
+**This endpoint allows you to retrieve the total sums of each email statistic metric for all subusers over the given date range.**
+
+
+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.
+
+For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).
+
+### GET /subusers/stats/sums
+
+
+```php
+$query_params = json_decode('{"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"}');
+$response = $sg->client->subusers()->stats()->sums()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Enable/disable a subuser
+
+This endpoint allows you to enable or disable a subuser.
+
+For more information about Subusers:
+
+* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)
+* [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)
+
+### PATCH /subusers/{subuser_name}
+
+
+```php
+$request_body = json_decode('{
+ "disabled": false
+}');
+$subuser_name = "test_url_param";
+$response = $sg->client->subusers()->_($subuser_name)->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a subuser
+
+This endpoint allows you to delete a subuser. This is a permanent action, once deleted a subuser cannot be retrieved.
+
+For more information about Subusers:
+
+* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)
+* [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)
+
+### DELETE /subusers/{subuser_name}
+
+
+```php
+$subuser_name = "test_url_param";
+$response = $sg->client->subusers()->_($subuser_name)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update IPs assigned to a subuser
+
+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.
+
+More information:
+
+* [How to request more IPs](https://sendgrid.com/docs/Classroom/Basics/Account/adding_an_additional_dedicated_ip_to_your_account.html)
+* [How to set up reverse DNS](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/)
+
+### PUT /subusers/{subuser_name}/ips
+
+
+```php
+$request_body = json_decode('[
+ "127.0.0.1"
+]');
+$subuser_name = "test_url_param";
+$response = $sg->client->subusers()->_($subuser_name)->ips()->put($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update Monitor Settings for a subuser
+
+Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.
+
+### PUT /subusers/{subuser_name}/monitor
+
+
+```php
+$request_body = json_decode('{
+ "email": "example@example.com",
+ "frequency": 500
+}');
+$subuser_name = "test_url_param";
+$response = $sg->client->subusers()->_($subuser_name)->monitor()->put($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Create monitor settings
+
+Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.
+
+### POST /subusers/{subuser_name}/monitor
+
+
+```php
+$request_body = json_decode('{
+ "email": "example@example.com",
+ "frequency": 50000
+}');
+$subuser_name = "test_url_param";
+$response = $sg->client->subusers()->_($subuser_name)->monitor()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve monitor settings for a subuser
+
+Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.
+
+### GET /subusers/{subuser_name}/monitor
+
+
+```php
+$subuser_name = "test_url_param";
+$response = $sg->client->subusers()->_($subuser_name)->monitor()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete monitor settings
+
+Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.
+
+### DELETE /subusers/{subuser_name}/monitor
+
+
+```php
+$subuser_name = "test_url_param";
+$response = $sg->client->subusers()->_($subuser_name)->monitor()->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve the monthly email statistics for a single subuser
+
+**This endpoint allows you to retrieve the monthly email statistics for a specific subuser.**
+
+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.
+
+When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics:
+`bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`.
+
+For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).
+
+### GET /subusers/{subuser_name}/stats/monthly
+
+
+```php
+$query_params = json_decode('{"date": "test_string", "sort_by_direction": "asc", "limit": 1, "sort_by_metric": "test_string", "offset": 1}');
+$subuser_name = "test_url_param";
+$response = $sg->client->subusers()->_($subuser_name)->stats()->monthly()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# SUPPRESSION
+
+## Retrieve all blocks
+
+**This endpoint allows you to retrieve a list of all email addresses that are currently on your blocks list.**
+
+[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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).
+
+### GET /suppression/blocks
+
+
+```php
+$query_params = json_decode('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}');
+$response = $sg->client->suppression()->blocks()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete blocks
+
+**This endpoint allows you to delete all email addresses on your blocks list.**
+
+There are two options for deleting blocked emails:
+
+1. You can delete all blocked emails by setting `delete_all` to true in the request body.
+2. You can delete some blocked emails by specifying the email addresses in an array in the request body.
+
+[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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).
+
+### DELETE /suppression/blocks
+
+
+```php
+$request_body = json_decode('{
+ "delete_all": false,
+ "emails": [
+ "example1@example.com",
+ "example2@example.com"
+ ]
+}');
+$response = $sg->client->suppression()->blocks()->delete($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a specific block
+
+**This endpoint allows you to retrieve a specific email address from your blocks list.**
+
+[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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).
+
+### GET /suppression/blocks/{email}
+
+
+```php
+$email = "test_url_param";
+$response = $sg->client->suppression()->blocks()->_($email)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a specific block
+
+**This endpoint allows you to delete a specific email address from your blocks list.**
+
+[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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).
+
+### DELETE /suppression/blocks/{email}
+
+
+```php
+$email = "test_url_param";
+$response = $sg->client->suppression()->blocks()->_($email)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all bounces
+
+**This endpoint allows you to retrieve all of your bounces.**
+
+Bounces are messages that are returned to the server that sent it.
+
+For more information see:
+
+* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information
+* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
+
+### GET /suppression/bounces
+
+
+```php
+$query_params = json_decode('{"start_time": 1, "end_time": 1}');
+$response = $sg->client->suppression()->bounces()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete bounces
+
+**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.**
+
+Bounces are messages that are returned to the server that sent it.
+
+For more information see:
+
+* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information
+* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
+* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html)
+
+Note: the `delete_all` and `emails` parameters should be used independently of each other as they have different purposes.
+
+### DELETE /suppression/bounces
+
+
+```php
+$request_body = json_decode('{
+ "delete_all": true,
+ "emails": [
+ "example@example.com",
+ "example2@example.com"
+ ]
+}');
+$response = $sg->client->suppression()->bounces()->delete($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a Bounce
+
+**This endpoint allows you to retrieve a specific bounce for a given email address.**
+
+Bounces are messages that are returned to the server that sent it.
+
+For more information see:
+
+* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information
+* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
+* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html)
+
+### GET /suppression/bounces/{email}
+
+
+```php
+$email = "test_url_param";
+$response = $sg->client->suppression()->bounces()->_($email)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a bounce
+
+**This endpoint allows you to remove an email address from your bounce list.**
+
+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.
+
+For more information see:
+
+* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information
+* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
+* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html)
+
+### DELETE /suppression/bounces/{email}
+
+
+```php
+$query_params = json_decode('{"email_address": "example@example.com"}');
+$email = "test_url_param";
+$response = $sg->client->suppression()->bounces()->_($email)->delete(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all invalid emails
+
+**This endpoint allows you to retrieve a list of all invalid email addresses.**
+
+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.
+
+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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).
+
+### GET /suppression/invalid_emails
+
+
+```php
+$query_params = json_decode('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}');
+$response = $sg->client->suppression()->invalid_emails()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete invalid emails
+
+**This endpoint allows you to remove email addresses from your invalid email address list.**
+
+There are two options for deleting invalid email addresses:
+
+1) You can delete all invalid email addresses by setting `delete_all` to true in the request body.
+2) You can delete some invalid email addresses by specifying certain addresses in an array in the request body.
+
+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.
+
+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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).
+
+### DELETE /suppression/invalid_emails
+
+
+```php
+$request_body = json_decode('{
+ "delete_all": false,
+ "emails": [
+ "example1@example.com",
+ "example2@example.com"
+ ]
+}');
+$response = $sg->client->suppression()->invalid_emails()->delete($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a specific invalid email
+
+**This endpoint allows you to retrieve a specific invalid email addresses.**
+
+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.
+
+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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).
+
+### GET /suppression/invalid_emails/{email}
+
+
+```php
+$email = "test_url_param";
+$response = $sg->client->suppression()->invalid_emails()->_($email)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a specific invalid email
+
+**This endpoint allows you to remove a specific email address from the invalid email address list.**
+
+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.
+
+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.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).
+
+### DELETE /suppression/invalid_emails/{email}
+
+
+```php
+$email = "test_url_param";
+$response = $sg->client->suppression()->invalid_emails()->_($email)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a specific spam report
+
+**This endpoint allows you to retrieve a specific spam report.**
+
+[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 Twilio SendGrid.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).
+
+### GET /suppression/spam_report/{email}
+
+
+```php
+$email = "test_url_param";
+$response = $sg->client->suppression()->spam_reports()->_($email)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a specific spam report
+
+**This endpoint allows you to delete a specific spam report.**
+
+[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 Twilio SendGrid.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).
+
+### DELETE /suppression/spam_report/{email}
+
+
+```php
+$email = "test_url_param";
+$response = $sg->client->suppression()->spam_reports()->_($email)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all spam reports
+
+**This endpoint allows you to retrieve all spam reports.**
+
+[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 Twilio SendGrid.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).
+
+### GET /suppression/spam_reports
+
+
+```php
+$query_params = json_decode('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}');
+$response = $sg->client->suppression()->spam_reports()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete spam reports
+
+**This endpoint allows you to delete your spam reports.**
+
+There are two options for deleting spam reports:
+
+1) You can delete all spam reports by setting "delete_all" to true in the request body.
+2) You can delete some spam reports by specifying the email addresses in an array in the request body.
+
+[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 Twilio SendGrid.
+
+For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).
+
+### DELETE /suppression/spam_reports
+
+
+```php
+$request_body = json_decode('{
+ "delete_all": false,
+ "emails": [
+ "example1@example.com",
+ "example2@example.com"
+ ]
+}');
+$response = $sg->client->suppression()->spam_reports()->delete($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all global suppressions
+
+**This endpoint allows you to retrieve a list of all email address that are globally suppressed.**
+
+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).
+
+### GET /suppression/unsubscribes
+
+
+```php
+$query_params = json_decode('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}');
+$response = $sg->client->suppression()->unsubscribes()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# TEMPLATES
+
+## Create a transactional template.
+
+**This endpoint allows you to create a transactional template.**
+
+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.
+
+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).
+
+### POST /templates
+
+
+```php
+$request_body = json_decode('{
+ "name": "example_name"
+}');
+$response = $sg->client->templates()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all transactional templates (legacy & dynamic).
+
+**This endpoint allows you to retrieve all transactional templates.**
+
+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.
+
+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).
+
+### GET /templates
+
+
+```php
+$query_params = json_decode('{"generations": "legacy,dynamic"}');
+$response = $sg->client->templates()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Edit a transactional template.
+
+**This endpoint allows you to edit a transactional template.**
+
+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.
+
+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).
+
+
+### PATCH /templates/{template_id}
+
+
+```php
+$request_body = json_decode('{
+ "name": "new_example_name"
+}');
+$template_id = "test_url_param";
+$response = $sg->client->templates()->_($template_id)->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a single transactional template.
+
+**This endpoint allows you to retrieve a single transactional template.**
+
+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.
+
+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).
+
+
+### GET /templates/{template_id}
+
+
+```php
+$template_id = "test_url_param";
+$response = $sg->client->templates()->_($template_id)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a template.
+
+**This endpoint allows you to delete a transactional template.**
+
+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.
+
+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).
+
+
+### DELETE /templates/{template_id}
+
+
+```php
+$template_id = "test_url_param";
+$response = $sg->client->templates()->_($template_id)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Create a new transactional template version.
+
+**This endpoint allows you to create a new version of a template.**
+
+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.
+
+For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
+
+
+### POST /templates/{template_id}/versions
+
+
+```php
+$request_body = json_decode('{
+ "active": 1,
+ "html_content": "<%body%>",
+ "name": "example_version_name",
+ "plain_content": "<%body%>",
+ "subject": "<%subject%>",
+ "template_id": "ddb96bbc-9b92-425e-8979-99464621b543"
+}');
+$template_id = "test_url_param";
+$response = $sg->client->templates()->_($template_id)->versions()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Edit a transactional template version.
+
+**This endpoint allows you to edit a version of one of your transactional templates.**
+
+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.
+
+For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
+
+## URI Parameters
+| URI Parameter | Type | Description |
+|---|---|---|
+| template_id | string | The ID of the original template |
+| version_id | string | The ID of the template version |
+
+### PATCH /templates/{template_id}/versions/{version_id}
+
+
+```php
+$request_body = json_decode('{
+ "active": 1,
+ "html_content": "<%body%>",
+ "name": "updated_example_name",
+ "plain_content": "<%body%>",
+ "subject": "<%subject%>"
+}');
+$template_id = "test_url_param";
+$version_id = "test_url_param";
+$response = $sg->client->templates()->_($template_id)->versions()->_($version_id)->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a specific transactional template version.
+
+**This endpoint allows you to retrieve a specific version of a template.**
+
+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.
+
+For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
+
+## URI Parameters
+| URI Parameter | Type | Description |
+|---|---|---|
+| template_id | string | The ID of the original template |
+| version_id | string | The ID of the template version |
+
+### GET /templates/{template_id}/versions/{version_id}
+
+
+```php
+$template_id = "test_url_param";
+$version_id = "test_url_param";
+$response = $sg->client->templates()->_($template_id)->versions()->_($version_id)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a transactional template version.
+
+**This endpoint allows you to delete one of your transactional template versions.**
+
+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.
+
+For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
+
+## URI Parameters
+| URI Parameter | Type | Description |
+|---|---|---|
+| template_id | string | The ID of the original template |
+| version_id | string | The ID of the template version |
+
+### DELETE /templates/{template_id}/versions/{version_id}
+
+
+```php
+$template_id = "test_url_param";
+$version_id = "test_url_param";
+$response = $sg->client->templates()->_($template_id)->versions()->_($version_id)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Activate a transactional template version.
+
+**This endpoint allows you to activate a version of one of your templates.**
+
+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.
+
+
+For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
+
+## URI Parameters
+| URI Parameter | Type | Description |
+|---|---|---|
+| template_id | string | The ID of the original template |
+| version_id | string | The ID of the template version |
+
+### POST /templates/{template_id}/versions/{version_id}/activate
+
+
+```php
+$template_id = "test_url_param";
+$version_id = "test_url_param";
+$response = $sg->client->templates()->_($template_id)->versions()->_($version_id)->activate()->post();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# TRACKING SETTINGS
+
+## Retrieve Tracking Settings
+
+**This endpoint allows you to retrieve a list of all tracking settings that you can enable on your account.**
+
+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.
+
+For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
+
+### GET /tracking_settings
+
+
+```php
+$query_params = json_decode('{"limit": 1, "offset": 1}');
+$response = $sg->client->tracking_settings()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update Click Tracking Settings
+
+**This endpoint allows you to change your current click tracking setting. You can enable, or disable, click tracking using this endpoint.**
+
+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.
+
+For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
+
+### PATCH /tracking_settings/click
+
+
+```php
+$request_body = json_decode('{
+ "enabled": true
+}');
+$response = $sg->client->tracking_settings()->click()->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve Click Track Settings
+
+**This endpoint allows you to retrieve your current click tracking setting.**
+
+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.
+
+For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
+
+### GET /tracking_settings/click
+
+
+```php
+$response = $sg->client->tracking_settings()->click()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update Google Analytics Settings
+
+**This endpoint allows you to update your current setting for Google Analytics.**
+
+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).
+
+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).
+
+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.
+
+For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
+
+### PATCH /tracking_settings/google_analytics
+
+
+```php
+$request_body = json_decode('{
+ "enabled": true,
+ "utm_campaign": "website",
+ "utm_content": "",
+ "utm_medium": "email",
+ "utm_source": "sendgrid.com",
+ "utm_term": ""
+}');
+$response = $sg->client->tracking_settings()->google_analytics()->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve Google Analytics Settings
+
+**This endpoint allows you to retrieve your current setting for Google Analytics.**
+
+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).
+
+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).
+
+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.
+
+For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
+
+### GET /tracking_settings/google_analytics
+
+
+```php
+$response = $sg->client->tracking_settings()->google_analytics()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update Open Tracking Settings
+
+**This endpoint allows you to update your current settings for open tracking.**
+
+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.
+
+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.
+
+For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
+
+### PATCH /tracking_settings/open
+
+
+```php
+$request_body = json_decode('{
+ "enabled": true
+}');
+$response = $sg->client->tracking_settings()->open()->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Get Open Tracking Settings
+
+**This endpoint allows you to retrieve your current settings for open tracking.**
+
+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.
+
+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.
+
+For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
+
+### GET /tracking_settings/open
+
+
+```php
+$response = $sg->client->tracking_settings()->open()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update Subscription Tracking Settings
+
+**This endpoint allows you to update your current settings for subscription tracking.**
+
+Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails.
+
+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.
+
+For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
+
+### PATCH /tracking_settings/subscription
+
+
+```php
+$request_body = json_decode('{
+ "enabled": true,
+ "html_content": "html content",
+ "landing": "landing page html",
+ "plain_content": "text content",
+ "replace": "replacement tag",
+ "url": "url"
+}');
+$response = $sg->client->tracking_settings()->subscription()->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve Subscription Tracking Settings
+
+**This endpoint allows you to retrieve your current settings for subscription tracking.**
+
+Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails.
+
+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.
+
+For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
+
+### GET /tracking_settings/subscription
+
+
+```php
+$response = $sg->client->tracking_settings()->subscription()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+
+# USER
+
+## Get a user's account information.
+
+**This endpoint allows you to retrieve your user account details.**
+
+Your user's account information includes the user's account type and reputation.
+
+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.
+
+For more information about your user profile:
+
+* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
+
+### GET /user/account
+
+
+```php
+$response = $sg->client->user()->account()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve your credit balance
+
+**This endpoint allows you to retrieve the current credit balance for your account.**
+
+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).
+
+### GET /user/credits
+
+
+```php
+$response = $sg->client->user()->credits()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update your account email address
+
+**This endpoint allows you to update the email address currently on file for your account.**
+
+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.
+
+For more information about your user profile:
+
+* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
+
+### PUT /user/email
+
+
+```php
+$request_body = json_decode('{
+ "email": "example@example.com"
+}');
+$response = $sg->client->user()->email()->put($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve your account email address
+
+**This endpoint allows you to retrieve the email address currently on file for your account.**
+
+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.
+
+For more information about your user profile:
+
+* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
+
+### GET /user/email
+
+
+```php
+$response = $sg->client->user()->email()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update your password
+
+**This endpoint allows you to update your password.**
+
+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.
+
+For more information about your user profile:
+
+* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
+
+### PUT /user/password
+
+
+```php
+$request_body = json_decode('{
+ "new_password": "new_password",
+ "old_password": "old_password"
+}');
+$response = $sg->client->user()->password()->put($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update a user's profile
+
+**This endpoint allows you to update your current profile details.**
+
+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.
+
+For more information about your user profile:
+
+* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
+
+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.
+
+### PATCH /user/profile
+
+
+```php
+$request_body = json_decode('{
+ "city": "Orange",
+ "first_name": "Example",
+ "last_name": "User"
+}');
+$response = $sg->client->user()->profile()->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Get a user's profile
+
+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.
+
+For more information about your user profile:
+
+* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
+
+### GET /user/profile
+
+
+```php
+$response = $sg->client->user()->profile()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Cancel or pause a scheduled send
+
+**This endpoint allows you to cancel or pause an email that has been scheduled to be sent.**
+
+If the maximum number of cancellations/pauses are added, HTTP 400 will
+be returned.
+
+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.
+
+### POST /user/scheduled_sends
+
+
+```php
+$request_body = json_decode('{
+ "batch_id": "YOUR_BATCH_ID",
+ "status": "pause"
+}');
+$response = $sg->client->user()->scheduled_sends()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all scheduled sends
+
+**This endpoint allows you to retrieve all cancel/paused scheduled send information.**
+
+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.
+
+### GET /user/scheduled_sends
+
+
+```php
+$response = $sg->client->user()->scheduled_sends()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update user scheduled send information
+
+**This endpoint allows you to update the status of a scheduled send for the given `batch_id`.**
+
+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.
+
+### PATCH /user/scheduled_sends/{batch_id}
+
+
+```php
+$request_body = json_decode('{
+ "status": "pause"
+}');
+$batch_id = "test_url_param";
+$response = $sg->client->user()->scheduled_sends()->_($batch_id)->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve scheduled send
+
+**This endpoint allows you to retrieve the cancel/paused scheduled send information for a specific `batch_id`.**
+
+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.
+
+### GET /user/scheduled_sends/{batch_id}
+
+
+```php
+$batch_id = "test_url_param";
+$response = $sg->client->user()->scheduled_sends()->_($batch_id)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a cancellation or pause of a scheduled send
+
+**This endpoint allows you to delete the cancellation/pause of a scheduled send.**
+
+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.
+
+### DELETE /user/scheduled_sends/{batch_id}
+
+
+```php
+$batch_id = "test_url_param";
+$response = $sg->client->user()->scheduled_sends()->_($batch_id)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update Enforced TLS settings
+
+**This endpoint allows you to update your current Enforced TLS settings.**
+
+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.
+
+**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.
+
+### PATCH /user/settings/enforced_tls
+
+
+```php
+$request_body = json_decode('{
+ "require_tls": true,
+ "require_valid_cert": false
+}');
+$response = $sg->client->user()->settings()->enforced_tls()->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve current Enforced TLS settings.
+
+**This endpoint allows you to retrieve your current Enforced TLS settings.**
+
+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.
+
+**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.
+
+### GET /user/settings/enforced_tls
+
+
+```php
+$response = $sg->client->user()->settings()->enforced_tls()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update your username
+
+**This endpoint allows you to update the username for your account.**
+
+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.
+
+For more information about your user profile:
+
+* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
+
+### PUT /user/username
+
+
+```php
+$request_body = json_decode('{
+ "username": "test_username"
+}');
+$response = $sg->client->user()->username()->put($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve your username
+
+**This endpoint allows you to retrieve your current account username.**
+
+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.
+
+For more information about your user profile:
+
+* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
+
+### GET /user/username
+
+
+```php
+$response = $sg->client->user()->username()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update Event Notification Settings
+
+**This endpoint allows you to update your current event webhook settings.**
+
+If an event type is marked as `true`, then the event webhook will include information about that event.
+
+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.
+
+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.
+
+### PATCH /user/webhooks/event/settings
+
+
+```php
+$request_body = json_decode('{
+ "bounce": true,
+ "click": true,
+ "deferred": true,
+ "delivered": true,
+ "dropped": true,
+ "enabled": true,
+ "group_resubscribe": true,
+ "group_unsubscribe": true,
+ "open": true,
+ "processed": true,
+ "spam_report": true,
+ "unsubscribe": true,
+ "url": "url"
+}');
+$response = $sg->client->user()->webhooks()->event()->settings()->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve Event Webhook settings
+
+**This endpoint allows you to retrieve your current event webhook settings.**
+
+If an event type is marked as `true`, then the event webhook will include information about that event.
+
+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.
+
+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.
+
+### GET /user/webhooks/event/settings
+
+
+```php
+$response = $sg->client->user()->webhooks()->event()->settings()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Test Event Notification Settings
+
+**This endpoint allows you to test your event webhook by sending a fake event notification post to the provided URL.**
+
+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.
+
+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.
+
+### POST /user/webhooks/event/test
+
+
+```php
+$request_body = json_decode('{
+ "url": "url"
+}');
+$response = $sg->client->user()->webhooks()->event()->test()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Create a parse setting
+
+**This endpoint allows you to create a new inbound parse setting.**
+
+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).
+
+### POST /user/webhooks/parse/settings
+
+
+```php
+$request_body = json_decode('{
+ "hostname": "myhostname.com",
+ "send_raw": false,
+ "spam_check": true,
+ "url": "http://email.myhosthame.com"
+}');
+$response = $sg->client->user()->webhooks()->parse()->settings()->post($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve all parse settings
+
+**This endpoint allows you to retrieve all of your current inbound parse settings.**
+
+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).
+
+### GET /user/webhooks/parse/settings
+
+
+```php
+$response = $sg->client->user()->webhooks()->parse()->settings()->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Update a parse setting
+
+**This endpoint allows you to update a specific inbound parse setting.**
+
+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).
+
+### PATCH /user/webhooks/parse/settings/{hostname}
+
+
+```php
+$request_body = json_decode('{
+ "send_raw": true,
+ "spam_check": false,
+ "url": "http://newdomain.com/parse"
+}');
+$hostname = "test_url_param";
+$response = $sg->client->user()->webhooks()->parse()->settings()->_($hostname)->patch($request_body);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieve a specific parse setting
+
+**This endpoint allows you to retrieve a specific inbound parse setting.**
+
+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).
+
+### GET /user/webhooks/parse/settings/{hostname}
+
+
+```php
+$hostname = "test_url_param";
+$response = $sg->client->user()->webhooks()->parse()->settings()->_($hostname)->get();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Delete a parse setting
+
+**This endpoint allows you to delete a specific inbound parse setting.**
+
+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).
+
+### DELETE /user/webhooks/parse/settings/{hostname}
+
+
+```php
+$hostname = "test_url_param";
+$response = $sg->client->user()->webhooks()->parse()->settings()->_($hostname)->delete();
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
+## Retrieves Inbound Parse Webhook statistics.
+
+**This endpoint allows you to retrieve the statistics for your Parse Webhook usage.**
+
+Twilio 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.
+
+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).
+
+### GET /user/webhooks/parse/stats
+
+
+```php
+$query_params = json_decode('{"aggregated_by": "day", "limit": "test_string", "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": "test_string"}');
+$response = $sg->client->user()->webhooks()->parse()->stats()->get(null, $query_params);
+print $response->statusCode() . "\n";
+print $response->body() . "\n";
+print_r($response->headers());
+```
diff --git a/lib/sendgrid-php/USE_CASES.md b/lib/sendgrid-php/USE_CASES.md
new file mode 100644
index 000000000..d103bf221
--- /dev/null
+++ b/lib/sendgrid-php/USE_CASES.md
@@ -0,0 +1,1627 @@
+This documentation provides examples for specific use cases. Please [open an issue](https://github.com/sendgrid/sendgrid-php/issues) or make a pull request for any use cases you would like us to document here. Thank you!
+
+# Table of Contents
+- [Table of Contents](#table-of-contents)
+- [Attachments](#attachments)
+- [Attaching a File from Box](#attaching-a-file-from-box)
+- [Attaching a File from S3](#attaching-a-file-from-s3)
+- [Kitchen Sink - an example with all settings used](#kitchen-sink)
+- [Send an Email to a Single Recipient](#send-an-email-to-a-single-recipient)
+- [Send an Email to Multiple Recipients](#send-an-email-to-multiple-recipients)
+- [Send Multiple Emails to Multiple Recipients](#send-multiple-emails-to-multiple-recipients)
+- [Send Multiple Emails with Personalizations](#multiple-email-personalizations)
+- [Set Region](#set-region)
+- [Transactional Templates](#transactional-templates)
+- [Legacy Templates](#legacy-templates)
+- [Send an Email With Twilio Email (Pilot)](#send-an-email-with-twilio-email-pilot)
+- [Send an SMS Message](#send-an-sms-message)
+- [How to Set up a Domain Authentication](#how-to-set-up-a-domain-authentication)
+- [How to View Email Statistics](#how-to-view-email-statistics)
+- [How to Use the Email Activity Feed](#how-to-use-the-email-activity-feed-api)
+- [Deploying to Heroku](#deploying-to-heroku)
+- [Google App Engine Installation](#google-app-engine-installation)
+
+
+# Attachments
+
+Here is an example of attaching a text file to your email, assuming that text file `my_file.txt` is located in the same directory. You can use the `addAttachments` method to add an array attachments.
+
+```php
+/sendgrid-php.php';
+
+use SendGrid\Mail\Mail;
+
+$email = new Mail();
+$email->setFrom("test@example.com", "Example User");
+$email->setSubject("Sending with Twilio SendGrid is Fun");
+$email->addTo("test@example.com", "Example User");
+$email->addContent("text/plain", "and easy to do anywhere, even with PHP");
+$email->addContent(
+ "text/html", "and easy to do anywhere, even with PHP"
+);
+
+$file_encoded = base64_encode(file_get_contents('my_file.txt'));
+$email->addAttachment(
+ $file_encoded,
+ "application/text",
+ "my_file.txt",
+ "attachment"
+);
+
+$sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
+try {
+ $response = $sendgrid->send($email);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: '. $e->getMessage(). "\n";
+}
+```
+
+
+# Attaching a File from Box
+
+You can attach a file from [Box](https://www.box.com) to your emails.
+Because there is no official Box SDK for PHP, this example requires
+[firebase/php-jwt](https://github.com/firebase/php-jwt) to generate a
+[JSON Web Token](https://jwt.io) assertion. Before using this code, you should
+set up a JWT application on [Box](https://developer.box.com/docs/setting-up-a-jwt-app).
+For more information about authenticating with JWT, see
+[this page](https://developer.box.com/docs/construct-jwt-claim-manually).
+
+After completing the setup tutorial, you will want to make sure your app’s
+configuration settings have at least the following options enabled:
+
+**Application Access**
+* Enterprise
+
+**Application Scopes**
+* Read all files and folders stored in Box
+* Read and write all files and folders stored in Box
+* Manage users
+
+**Advanced Features**
+* Perform Actions as Users
+
+Remember to reauthorize your app
+[here](https://app.box.com/master/settings/openbox) after making any changes to
+your app’s JWT scopes.
+
+```php
+ 'RS256',
+ 'typ' => 'JWT',
+ 'kid' => $boxConfig->boxAppSettings->appAuth->publicKeyID
+);
+$claims = array(
+ 'iss' => $boxConfig->boxAppSettings->clientID,
+ 'sub' => $boxConfig->enterpriseID,
+ 'box_sub_type' => 'enterprise',
+ 'aud' => 'https://api.box.com/oauth2/token',
+ 'jti' => bin2hex(openssl_random_pseudo_bytes(16)),
+ 'exp' => time() + 50
+);
+
+$privateKey = openssl_get_privatekey(
+ $boxConfig->boxAppSettings->appAuth->privateKey,
+ $boxConfig->boxAppSettings->appAuth->passphrase
+);
+
+$assertion = JWT::encode($claims, $privateKey, 'RS256', null, $header);
+
+// Get access token
+$url = 'https://api.box.com/oauth2/token';
+$data = array(
+ 'grant_type' => 'urn:ietf:params:oauth:grant-type:jwt-bearer',
+ 'client_id' => $boxConfig->boxAppSettings->clientID,
+ 'client_secret' => $boxConfig->boxAppSettings->clientSecret,
+ 'assertion' => $assertion
+);
+$ch = curl_init($url);
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
+$result = json_decode(curl_exec($ch));
+curl_close($ch);
+$accessToken = $result->access_token;
+
+// Get user ID
+$url = 'https://api.box.com/2.0/users';
+$ch = curl_init($url);
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, array(
+ 'Authorization: Bearer '.$accessToken
+));
+$result = json_decode(curl_exec($ch));
+curl_close($ch);
+foreach ($result->entries as $entry){
+ if ($entry->login === $fileOwner){
+ $userId = $entry->id;
+ }
+}
+
+// Get file ID
+$url = 'https://api.box.com/2.0/search';
+$data = array(
+ 'query' => urlencode(end($path))
+);
+$urlEncoded = http_build_query($data);
+$ch = curl_init($url.'?'.$urlEncoded);
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, array(
+ 'Authorization: Bearer '.$accessToken,
+ 'As-User: '.$userId
+));
+$result = json_decode(curl_exec($ch));
+curl_close($ch);
+foreach ($result->entries as $entry){
+ if (count($entry->path_collection->entries) === count($path) -1){
+ if (count($path) > 2){
+ // File is located in a subdirectory.
+ for ($i = 1; $i < (count($path) - 1); $i++){
+ if ($path[$i] === $entry->path_collection->entries[$i]->name){
+ $fileId = $entry->id;
+ }
+ }
+ } else {
+ // File is located in default directory.
+ $fileId = $entry->id;
+ }
+ }
+}
+
+if (isset($fileId) && isset($userId)){
+ // Get file data
+ $url = 'https://api.box.com/2.0/files/'.$fileId.'/content';
+ $ch = curl_init($url);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array(
+ 'Authorization: Bearer '.$accessToken,
+ 'As-User: '.$userId
+ ));
+ $result = curl_exec($ch);
+ $contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
+ curl_close($ch);
+
+ $attachmentFilename = end($path);
+ $attachmentContent = base64_encode($result);
+ $attachmentContentType = $contentType;
+
+ $email = new \SendGrid\Mail\Mail();
+ $email->setFrom("test@example.com", "Example User");
+ $email->setSubject("Attaching a File from Box");
+ $email->addTo("test@example.com", "Example User");
+ $email->addContent("text/plain", "See attached file from Box.");
+ $email->addContent(
+ "text/html", "See attached file from Box."
+ );
+
+ $attachment = new \SendGrid\Mail\Attachment();
+ $attachment->setContent($attachmentContent);
+ $attachment->setType($attachmentContentType);
+ $attachment->setFilename($attachmentFilename);
+ $attachment->setDisposition("attachment");
+ $attachment->setContentId($attachmentFilename); // Only used if disposition is set to inline
+ $email->addAttachment($attachment);
+
+ $sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
+ try {
+ $response = $sendgrid->send($email);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+ } catch (Exception $e) {
+ echo 'Caught exception: '. $e->getMessage() ."\n";
+ }
+} else {
+ echo "Error: file or owner could not be located\n";
+}
+```
+
+
+# Attaching a File from S3
+
+You can attach a file from [Amazon S3 storage](https://aws.amazon.com/s3/) to your emails. In addition to sendgrid-php, this requires the [AWS SDK for PHP](https://aws.amazon.com/sdk-for-php/). Please follow the [Getting Started](https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/getting-started_index.html) tutorial at Amazon if you haven’t set up your AWS SDK installation yet.
+
+```php
+ 'latest',
+ 'region' => 'us-east-1' // This should match the region of your S3 bucket.
+]);
+try {
+ // Get the object.
+ // See https://docs.aws.amazon.com/AmazonS3/latest/dev/RetrieveObjSingleOpPHP.html
+ $result = $s3->getObject([
+ 'Bucket' => $bucket,
+ 'Key' => $keyname
+ ]);
+ $keyExplode = explode('/',$keyname);
+ $attachmentFilename = end($keyExplode);
+ $attachmentContent = base64_encode($result['Body']);
+ $attachmentContentType = $result['ContentType'];
+
+ $email = new \SendGrid\Mail\Mail();
+ $email->setFrom("test@example.com", "Example User");
+ $email->setSubject("Attaching a File from S3");
+ $email->addTo("test@example.com", "Example User");
+ $email->addContent("text/plain", "See attached file from S3.");
+ $email->addContent(
+ "text/html", "See attached file from S3."
+ );
+
+ $attachment = new \SendGrid\Mail\Attachment();
+ $attachment->setContent($attachmentContent);
+ $attachment->setType($attachmentContentType);
+ $attachment->setFilename($attachmentFilename);
+ $attachment->setDisposition("attachment");
+ $attachment->setContentId($attachmentFilename); //Only used if disposition is set to inline
+ $email->addAttachment($attachment);
+ $sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
+ try {
+ $response = $sendgrid->send($email);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+ } catch (Exception $e) {
+ echo 'Caught exception: '. $e->getMessage() ."\n";
+ }
+} catch (S3Exception $e) {
+ echo 'Caught exception: '. $e->getMessage() . "\n";
+}
+```
+
+
+# Kitchen Sink - an example with all settings used
+
+```php
+/sendgrid-php.php';
+
+use SendGrid\Mail\Mail;
+
+$email = new Mail();
+
+// For a detailed description of each of these settings,
+// please see the
+// [documentation](https://sendgrid.com/docs/API_Reference/api_v3.html).
+$email->setSubject("Sending with Twilio SendGrid is Fun 2");
+
+$email->addTo("test@example.com", "Example User");
+$email->addTo("test+1@example.com", "Example User1");
+$toEmails = [
+ "test+2@example.com" => "Example User2",
+ "test+3@example.com" => "Example User3"
+];
+$email->addTos($toEmails);
+
+$email->addCc("test+4@example.com", "Example User4");
+$ccEmails = [
+ "test+5@example.com" => "Example User5",
+ "test+6@example.com" => "Example User6"
+];
+$email->addCcs($ccEmails);
+
+$email->addBcc("test+7@example.com", "Example User7");
+$bccEmails = [
+ "test+8@example.com" => "Example User8",
+ "test+9@example.com" => "Example User9"
+];
+$email->addBccs($bccEmails);
+
+$email->addHeader("X-Test1", "Test1");
+$email->addHeader("X-Test2", "Test2");
+$headers = [
+ "X-Test3" => "Test3",
+ "X-Test4" => "Test4",
+];
+$email->addHeaders($headers);
+
+$email->addDynamicTemplateData("subject1", "Example Subject 1");
+$email->addDynamicTemplateData("name1", "Example Name 1");
+$email->addDynamicTemplateData("city1", "Denver");
+$substitutions = [
+ "subject2" => "Example Subject 2",
+ "name2" => "Example Name 2",
+ "city2" => "Orange"
+];
+$email->addDynamicTemplateDatas($substitutions);
+
+$email->addCustomArg("marketing1", "false");
+$email->addCustomArg("transactional1", "true");
+$email->addCustomArg("category", "name");
+$customArgs = [
+ "marketing2" => "true",
+ "transactional2" => "false",
+ "category" => "name"
+];
+$email->addCustomArgs($customArgs);
+
+$email->setSendAt(1461775051);
+
+// You can add a personalization index or personalization parameter to the above
+// methods to add and update multiple personalizations. You can learn more about
+// personalizations [here](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/personalizations.html).
+
+// The values below this comment are global to an entire message
+
+$email->setFrom("test@example.com", "Twilio SendGrid");
+
+$email->setGlobalSubject("Sending with Twilio SendGrid is Fun and Global 2");
+
+$email->addContent(
+ "text/plain",
+ "and easy to do anywhere, even with PHP"
+);
+$email->addContent(
+ "text/html",
+ "and easy to do anywhere, even with PHP"
+);
+$contents = [
+ "text/calendar" => "Party Time!!",
+ "text/calendar2" => "Party Time 2!!"
+];
+$email->addContents($contents);
+
+$email->addAttachment(
+ "base64 encoded content1",
+ "image/png",
+ "banner.png",
+ "inline",
+ "Banner"
+);
+$attachments = [
+ [
+ "base64 encoded content2",
+ "image/jpeg",
+ "banner2.jpeg",
+ "attachment",
+ "Banner 3"
+ ],
+ [
+ "base64 encoded content3",
+ "image/gif",
+ "banner3.gif",
+ "inline",
+ "Banner 3"
+ ]
+];
+$email->addAttachments($attachments);
+
+$email->setTemplateId("d-13b8f94fbcae4ec6b75270d6cb59f932");
+
+$email->addGlobalHeader("X-Day", "Monday");
+$globalHeaders = [
+ "X-Month" => "January",
+ "X-Year" => "2017"
+];
+$email->addGlobalHeaders($globalHeaders);
+
+$email->addSection("%section1%", "Substitution for Section 1 Tag");
+$sections = [
+ "%section3%" => "Substitution for Section 3 Tag",
+ "%section4%" => "Substitution for Section 4 Tag"
+];
+$email->addSections($sections);
+
+$email->addCategory("Category 1");
+$categories = [
+ "Category 2",
+ "Category 3"
+];
+$email->addCategories($categories);
+
+$email->setBatchId(
+ "MWQxZmIyODYtNjE1Ni0xMWU1LWI3ZTUtMDgwMDI3OGJkMmY2LWEzMmViMjYxMw"
+);
+
+$email->setReplyTo("dx+replyto2@example.com", "DX Team Reply To 2");
+
+$email->setAsm(1, [1, 2, 3, 4]);
+
+$email->setIpPoolName("23");
+
+// Mail Settings
+$email->setBccSettings(true, "bcc@example.com");
+// Note: Bypass Spam, Bounce, and Unsubscribe management cannot
+// be combined with Bypass List Management
+$email->enableBypassBounceManagement();
+$email->enableBypassListManagement();
+$email->enableBypassSpamManagement();
+$email->enableBypassUnsubscribeManagement();
+//$email->disableBypassListManagement();
+$email->setFooter(true, "Footer", "Footer");
+$email->enableSandBoxMode();
+//$email->disableSandBoxMode();
+$email->setSpamCheck(true, 1, "http://mydomain.com");
+
+// Tracking Settings
+$email->setClickTracking(true, true);
+$email->setOpenTracking(true, "--sub--");
+$email->setSubscriptionTracking(
+ true,
+ "subscribe",
+ "subscribe",
+ "%%sub%%"
+);
+$email->setGanalytics(
+ true,
+ "utm_source",
+ "utm_medium",
+ "utm_term",
+ "utm_content",
+ "utm_campaign"
+);
+
+$sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
+try {
+ $response = $sendgrid->send($email);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: '. $e->getMessage(). "\n";
+}
+```
+
+OR
+
+```php
+/sendgrid-php.php';
+
+use SendGrid\Mail\Asm;
+use SendGrid\Mail\Attachment;
+use SendGrid\Mail\BatchId;
+use SendGrid\Mail\Bcc;
+use SendGrid\Mail\BccSettings;
+use SendGrid\Mail\BypassBounceManagement;
+use SendGrid\Mail\BypassListManagement;
+use SendGrid\Mail\BypassSpamManagement;
+use SendGrid\Mail\BypassUnsubscribeManagement;
+use SendGrid\Mail\Category;
+use SendGrid\Mail\Cc;
+use SendGrid\Mail\ClickTracking;
+use SendGrid\Mail\Content;
+use SendGrid\Mail\CustomArg;
+use SendGrid\Mail\Footer;
+use SendGrid\Mail\From;
+use SendGrid\Mail\Ganalytics;
+use SendGrid\Mail\GroupId;
+use SendGrid\Mail\GroupsToDisplay;
+use SendGrid\Mail\Header;
+use SendGrid\Mail\HtmlContent;
+use SendGrid\Mail\IpPoolName;
+use SendGrid\Mail\Mail;
+use SendGrid\Mail\MailSettings;
+use SendGrid\Mail\OpenTracking;
+use SendGrid\Mail\PlainTextContent;
+use SendGrid\Mail\ReplyTo;
+use SendGrid\Mail\SandBoxMode;
+use SendGrid\Mail\Section;
+use SendGrid\Mail\SendAt;
+use SendGrid\Mail\SpamCheck;
+use SendGrid\Mail\Subject;
+use SendGrid\Mail\SubscriptionTracking;
+use SendGrid\Mail\Substitution;
+use SendGrid\Mail\TemplateId;
+use SendGrid\Mail\To;
+use SendGrid\Mail\TrackingSettings;
+
+$email = new Mail();
+
+// For a detailed description of each of these settings,
+// please see the
+// [documentation](https://sendgrid.com/docs/API_Reference/api_v3.html).
+$email->setSubject(
+ new Subject("Sending with Twilio SendGrid is Fun 2")
+);
+
+$email->addTo(new To("test@example.com", "Example User"));
+$email->addTo(new To("test+1@example.com", "Example User1"));
+$toEmails = [
+ new To("test+2@example.com", "Example User2"),
+ new To("test+3@example.com", "Example User3")
+];
+$email->addTos($toEmails);
+
+$email->addCc(new Cc("test+4@example.com", "Example User4"));
+$ccEmails = [
+ new Cc("test+5@example.com", "Example User5"),
+ new Cc("test+6@example.com", "Example User6")
+];
+$email->addCcs($ccEmails);
+
+$email->addBcc(
+ new Bcc("test+7@example.com", "Example User7")
+);
+$bccEmails = [
+ new Bcc("test+8@example.com", "Example User8"),
+ new Bcc("test+9@example.com", "Example User9")
+];
+$email->addBccs($bccEmails);
+
+$email->addHeader(new Header("X-Test1", "Test1"));
+$email->addHeader(new Header("X-Test2", "Test2"));
+$headers = [
+ new Header("X-Test3", "Test3"),
+ new Header("X-Test4", "Test4")
+];
+$email->addHeaders($headers);
+
+$email->addDynamicTemplateData(
+ new Substitution("subject1", "Example Subject 1")
+);
+$email->addDynamicTemplateData(
+ new Substitution("name", "Example Name 1")
+);
+$email->addDynamicTemplateData(
+ new Substitution("city1", "Denver")
+);
+$substitutions = [
+ new Substitution("subject2", "Example Subject 2"),
+ new Substitution("name2", "Example Name 2"),
+ new Substitution("city2", "Orange")
+];
+$email->addDynamicTemplateDatas($substitutions);
+
+$email->addCustomArg(new CustomArg("marketing1", "false"));
+$email->addCustomArg(new CustomArg("transactional1", "true"));
+$email->addCustomArg(new CustomArg("category", "name"));
+$customArgs = [
+ new CustomArg("marketing2", "true"),
+ new CustomArg("transactional2", "false"),
+ new CustomArg("category", "name")
+];
+$email->addCustomArgs($customArgs);
+
+$email->setSendAt(new SendAt(1461775051));
+
+// You can add a personalization index or personalization parameter to the above
+// methods to add and update multiple personalizations. You can learn more about
+// personalizations [here](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/personalizations.html).
+
+// The values below this comment are global to an entire message
+
+$email->setFrom(new From("test@example.com", "Twilio SendGrid"));
+
+$email->setGlobalSubject(
+ new Subject("Sending with Twilio SendGrid is Fun and Global 2")
+);
+
+$plainTextContent = new PlainTextContent(
+ "and easy to do anywhere, even with PHP"
+);
+$htmlContent = new HtmlContent(
+ "and easy to do anywhere, even with PHP"
+);
+$email->addContent($plainTextContent);
+$email->addContent($htmlContent);
+$contents = [
+ new Content("text/calendar", "Party Time!!"),
+ new Content("text/calendar2", "Party Time 2!!")
+];
+$email->addContents($contents);
+
+$email->addAttachment(
+ new Attachment(
+ "base64 encoded content1",
+ "image/png",
+ "banner.png",
+ "inline",
+ "Banner"
+ )
+);
+$attachments = [
+ new Attachment(
+ "base64 encoded content2",
+ "banner2.jpeg",
+ "image/jpeg",
+ "attachment",
+ "Banner 3"
+ ),
+ new Attachment(
+ "base64 encoded content3",
+ "banner3.gif",
+ "image/gif",
+ "inline",
+ "Banner 3"
+ )
+];
+$email->addAttachments($attachments);
+
+$email->setTemplateId(
+ new TemplateId("d-13b8f94fbcae4ec6b75270d6cb59f932")
+);
+
+$email->addGlobalHeader(new Header("X-Day", "Monday"));
+$globalHeaders = [
+ new Header("X-Month", "January"),
+ new Header("X-Year", "2017")
+];
+$email->addGlobalHeaders($globalHeaders);
+
+$email->addSection(
+ new Section(
+ "%section1%",
+ "Substitution for Section 1 Tag"
+ )
+);
+
+$sections = [
+ new Section(
+ "%section3%",
+ "Substitution for Section 3 Tag"
+ ),
+ new Section(
+ "%section4%",
+ "Substitution for Section 4 Tag"
+ )
+];
+$email->addSections($sections);
+
+$email->addCategory(new Category("Category 1"));
+$categories = [
+ new Category("Category 2"),
+ new Category("Category 3")
+];
+$email->addCategories($categories);
+
+$email->setBatchId(
+ new BatchId(
+ "MWQxZmIyODYtNjE1Ni0xMWU1LWI3ZTUtMDgwMDI3OGJkMmY2LWEzMmViMjYxMw"
+ )
+);
+
+$email->setReplyTo(
+ new ReplyTo(
+ "dx+replyto2@example.com",
+ "DX Team Reply To 2"
+ )
+);
+
+$asm = new Asm(
+ new GroupId(1),
+ new GroupsToDisplay([1,2,3,4])
+);
+$email->setAsm($asm);
+
+$email->setIpPoolName(new IpPoolName("23"));
+
+$mail_settings = new MailSettings();
+$mail_settings->setBccSettings(
+ new BccSettings(true, "bcc@example.com")
+);
+
+// Note: Bypass Spam, Bounce, and Unsubscribe management cannot
+// be combined with Bypass List Management
+$mail_settings->setBypassBounceManagement(
+ new BypassBounceManagement(true)
+);
+$mail_settings->setBypassSpamManagement(
+ new BypassSpamManagement(true)
+);
+$mail_settings->setBypassUnsubscribeManagement(
+ new BypassUnsubscribeManagement(true)
+);
+
+// OR
+$mail_settings->setBypassListManagement(
+ new BypassListManagement(true)
+);
+
+$mail_settings->setFooter(
+ new Footer(true, "Footer", "Footer")
+);
+$mail_settings->setSandBoxMode(new SandBoxMode(true));
+$mail_settings->setSpamCheck(
+ new SpamCheck(true, 1, "http://mydomain.com")
+);
+$email->setMailSettings($mail_settings);
+
+$tracking_settings = new TrackingSettings();
+$tracking_settings->setClickTracking(
+ new ClickTracking(true, true)
+);
+$tracking_settings->setOpenTracking(
+ new OpenTracking(true, "--sub--")
+);
+$tracking_settings->setSubscriptionTracking(
+ new SubscriptionTracking(
+ true,
+ "subscribe",
+ "subscribe",
+ "%%sub%%"
+ )
+);
+$tracking_settings->setGanalytics(
+ new Ganalytics(
+ true,
+ "utm_source",
+ "utm_medium",
+ "utm_term",
+ "utm_content",
+ "utm_campaign"
+ )
+);
+$email->setTrackingSettings($tracking_settings);
+
+$sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
+try {
+ $response = $sendgrid->send($email);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: '. $e->getMessage(). "\n";
+}
+```
+
+
+# Send an Email to a Single Recipient
+
+```php
+/sendgrid-php.php';
+
+use SendGrid\Mail\Mail;
+
+$email = new Mail();
+$email->setFrom("test@example.com", "Example User");
+$email->setSubject("Sending with Twilio SendGrid is Fun");
+$email->addTo("test@example.com", "Example User");
+$email->addContent("text/plain", "and easy to do anywhere, even with PHP");
+$email->addContent(
+ "text/html", "and easy to do anywhere, even with PHP"
+);
+$sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
+try {
+ $response = $sendgrid->send($email);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: '. $e->getMessage(). "\n";
+}
+```
+
+OR
+
+```php
+/sendgrid-php.php';
+
+use SendGrid\Mail\From;
+use SendGrid\Mail\HtmlContent;
+use SendGrid\Mail\Mail;
+use SendGrid\Mail\PlainTextContent;
+use SendGrid\Mail\Subject;
+use SendGrid\Mail\To;
+
+$from = new From("test@example.com", "Example User");
+$subject = new Subject("Sending with Twilio SendGrid is Fun");
+$to = new To("test@example.com", "Example User");
+$plainTextContent = new PlainTextContent(
+ "and easy to do anywhere, even with PHP"
+);
+$htmlContent = new HtmlContent(
+ "and easy to do anywhere, even with PHP"
+);
+$email = new Mail(
+ $from,
+ $to,
+ $subject,
+ $plainTextContent,
+ $htmlContent
+);
+$sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
+try {
+ $response = $sendgrid->send($email);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: '. $e->getMessage(). "\n";
+}
+```
+
+
+# Send an Email to Multiple Recipients
+
+```php
+/sendgrid-php.php';
+
+use SendGrid\Mail\Mail;
+
+$email = new Mail();
+$email->setFrom("test@example.com", "Example User");
+$tos = [
+ "test+test1@example.com" => "Example User1",
+ "test+test2@example.com" => "Example User2",
+ "test+test3@example.com" => "Example User3"
+];
+$email->addTos($tos);
+$email->setSubject("Sending with Twilio SendGrid is Fun");
+$email->addContent("text/plain", "and easy to do anywhere, even with PHP");
+$email->addContent(
+ "text/html", "and easy to do anywhere, even with PHP"
+);
+$sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
+try {
+ $response = $sendgrid->send($email);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: '. $e->getMessage(). "\n";
+}
+```
+
+OR
+
+```php
+/sendgrid-php.php';
+
+use SendGrid\Mail\From;
+use SendGrid\Mail\HtmlContent;
+use SendGrid\Mail\Mail;
+use SendGrid\Mail\PlainTextContent;
+use SendGrid\Mail\Subject;
+use SendGrid\Mail\To;
+
+$from = new From("test@example.com", "Example User");
+$tos = [
+ new To("test+test1@example.com", "Example User1"),
+ new To("test+test2@example.com", "Example User2"),
+ new To("test+test3@example.com", "Example User3")
+];
+$subject = new Subject("Sending with Twilio SendGrid is Fun");
+$plainTextContent = new PlainTextContent(
+ "and easy to do anywhere, even with PHP"
+);
+$htmlContent = new HtmlContent(
+ "and easy to do anywhere, even with PHP"
+);
+$email = new Mail(
+ $from,
+ $tos,
+ $subject,
+ $plainTextContent,
+ $htmlContent
+);
+
+$sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
+try {
+ $response = $sendgrid->send($email);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: '. $e->getMessage(). "\n";
+}
+```
+
+
+# Send Multiple Emails to Multiple Recipients
+
+Note that [transactional templates](#transactional-templates) may be a better option for this use case, especially for more complex uses.
+
+```php
+/sendgrid-php.php';
+
+use SendGrid\Mail\From;
+use SendGrid\Mail\HtmlContent;
+use SendGrid\Mail\Mail;
+use SendGrid\Mail\PlainTextContent;
+use SendGrid\Mail\Subject;
+use SendGrid\Mail\To;
+
+$from = new From("test@example.com", "Example User");
+$tos = [
+ new To(
+ "test+test1@example.com",
+ "Example User1",
+ [
+ '-name-' => 'Example User 1',
+ '-github-' => 'http://github.com/example_user1'
+ ],
+ "Subject 1 -name-"
+ ),
+ new To(
+ "test+test2@example.com",
+ "Example User2",
+ [
+ '-name-' => 'Example User 2',
+ '-github-' => 'http://github.com/example_user2'
+ ],
+ "Subject 2 -name-"
+ ),
+ new To(
+ "test+test3@example.com",
+ "Example User3",
+ [
+ '-name-' => 'Example User 3',
+ '-github-' => 'http://github.com/example_user3'
+ ]
+ )
+];
+$subject = new Subject("Hi -name-!"); // default subject
+$globalSubstitutions = [
+ '-time-' => "2018-05-03 23:10:29"
+];
+$plainTextContent = new PlainTextContent(
+ "Hello -name-, your github is -github- sent at -time-"
+);
+$htmlContent = new HtmlContent(
+ "Hello -name-, your github is here sent at -time-"
+);
+$email = new Mail(
+ $from,
+ $tos,
+ $subject, // or array of subjects, these take precedence
+ $plainTextContent,
+ $htmlContent,
+ $globalSubstitutions
+);
+
+$sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
+try {
+ $response = $sendgrid->send($email);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: '. $e->getMessage(). "\n";
+}
+```
+
+OR
+
+```php
+/sendgrid-php.php';
+
+use SendGrid\Mail\From;
+use SendGrid\Mail\HtmlContent;
+use SendGrid\Mail\Mail;
+use SendGrid\Mail\PlainTextContent;
+use SendGrid\Mail\To;
+
+$from = new From("test@example.com", "Example User");
+$tos = [
+ new To(
+ "test+test1@example.com",
+ "Example User1",
+ [
+ '-name-' => 'Example User 1',
+ '-github-' => 'http://github.com/example_user1'
+ ],
+ "Example User1 -name-"
+ ),
+ new To(
+ "test+test2@example.com",
+ "Example User2",
+ [
+ '-name-' => 'Example User 2',
+ '-github-' => 'http://github.com/example_user2'
+ ],
+ "Example User2 -name-"
+ ),
+ new To(
+ "test+test3@example.com",
+ "Example User3",
+ [
+ '-name-' => 'Example User 3',
+ '-github-' => 'http://github.com/example_user3'
+ ]
+ )
+];
+$subject = [
+ "Subject 1 -name-",
+ "Subject 2 -name-"
+];
+$globalSubstitutions = [
+ '-time-' => "2018-05-03 23:10:29"
+];
+$plainTextContent = new PlainTextContent(
+ "Hello -name-, your github is -github- sent at -time-"
+);
+$htmlContent = new HtmlContent(
+ "Hello -name-, your github is here sent at -time-"
+);
+$email = new Mail(
+ $from,
+ $tos,
+ $subject, // or array of subjects, these take precedence
+ $plainTextContent,
+ $htmlContent,
+ $globalSubstitutions
+);
+
+$sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
+try {
+ $response = $sendgrid->send($email);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: '. $e->getMessage(). "\n";
+}
+```
+
+
+# Send Multiple Emails with Personalizations
+
+```php
+/sendgrid-php.php';
+
+use SendGrid\Mail\From;
+use SendGrid\Mail\Mail;
+use SendGrid\Mail\Personalization;
+use SendGrid\Mail\Subject;
+use SendGrid\Mail\To;
+
+$from = new From("test@example.com", "Twilio Sendgrid");
+$to = new To(
+ "test+test1@example.com",
+ "Example User1",
+ [
+ '-name-' => 'Example User 1'
+ ],
+ "Example User1 -name-"
+ );
+$subject = new Subject("Hello from Twilio Sendgrid!");
+$plainTextContent = new PlainTextContent(
+ "How's it going -name-?"
+);
+$htmlContent = new HtmlContent(
+ "How's it going -name-?"
+);
+$email = new Mail($from, $to, $subject, $plainTextContent, $htmlContent);
+
+$personalization0 = new Personalization();
+$personalization0->addTo(new To(
+ "test+test2@example.com",
+ "Example User2",
+ [
+ '-name-' => 'Example User 2'
+ ],
+ "Example User2 -name-"
+));
+$personalization0->addTo(new To(
+ "test+test3@example.com",
+ "Example User3",
+ [
+ '-name-' => 'Example User 3'
+ ],
+ "Example User3 -name-"
+));
+$personalization0->setSubject(new Subject("Hello from Twilio Sendgrid!"));
+$email->addPersonalization($personalization0);
+
+$personalization1 = new Personalization();
+$personalization1->addTo(new To(
+ "test+test3@example.com",
+ "Example User4",
+ [
+ '-name-' => 'Example User 4'
+ ],
+ "Example User4 -name-"
+));
+$personalization1->addTo(new To(
+ "test+test4@example.com",
+ "Example User5",
+ [
+ '-name-' => 'Example User 5'
+ ],
+ "Example User5 -name-"
+));
+$personalization1->addFrom(new From(
+ "test5@example.com" => "Twilio"
+))
+$personalization1->setSubject(new Subject("Hello from Twilio!"));
+$mail->addPersonalization($personalization1);
+
+$sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
+try {
+ $response = $sendgrid->send($email);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: '. $e->getMessage(). "\n";
+}
+```
+
+
+# Set Region
+The SendGrid object can also be used to set the region to "eu", which will send the request to https://api.eu.sendgrid.com/. By default, it is set to https://api.sendgrid.com/, e.g.
+
+```php
+/sendgrid-php.php';
+
+$sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
+$sendgrid->setDataResidency("eu");
+
+OR
+
+$sendgrid->setDataResidency("global");
+```
+
+
+# Transactional Templates
+
+For this example, we assume you have created a [dynamic transactional template](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/) in the UI or via the API. Following is the template content we used for testing.
+
+Template ID (replace with your own):
+
+```text
+d-13b8f94fbcae4ec6b75270d6cb59f932
+```
+
+Email Subject:
+
+```text
+{{ subject }}
+```
+
+Template Body:
+
+```html
+
+
+
+
+
+Hello {{ name }},
+
+I'm glad you are trying out the template feature!
+
+I hope you are having a great day in {{ city }} :)
+
+
+
+```
+
+```php
+/sendgrid-php.php';
+
+use SendGrid\Mail\From;
+use SendGrid\Mail\To;
+use SendGrid\Mail\Mail;
+
+$from = new From("test@example.com", "Example User");
+$tos = [
+ new To(
+ "test+test1@example.com",
+ "Example User1",
+ [
+ 'subject' => 'Subject 1',
+ 'name' => 'Example User 1',
+ 'city' => 'Denver'
+ ]
+ ),
+ new To(
+ "test+test2@example.com",
+ "Example User2",
+ [
+ 'subject' => 'Subject 2',
+ 'name' => 'Example User 2',
+ 'city' => 'Irvine'
+ ]
+ ),
+ new To(
+ "test+test3@example.com",
+ "Example User3",
+ [
+ 'subject' => 'Subject 3',
+ 'name' => 'Example User 3',
+ 'city' => 'Redwood City'
+ ]
+ )
+];
+$email = new Mail(
+ $from,
+ $tos
+);
+$email->setTemplateId("d-13b8f94fbcae4ec6b75270d6cb59f932");
+$sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
+try {
+ $response = $sendgrid->send($email);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: '. $e->getMessage(). "\n";
+}
+```
+
+OR
+
+```php
+/sendgrid-php.php';
+
+use SendGrid\Mail\Mail;
+
+$email = new Mail();
+$email->setFrom("test@sendgrid.com", "Example User");
+$email->setSubject("I'm replacing the subject tag");
+$email->addTo(
+ "test+test1@example.com",
+ "Example User1",
+ [
+ "subject" => "Subject 1",
+ "name" => "Example User 1",
+ "city" => "Denver"
+ ],
+ 0
+);
+$email->addTo(
+ "test+test2@example.com",
+ "Example User2",
+ [
+ "subject" => "Subject 2",
+ "name" => "Example User 2",
+ "city" => "Denver"
+ ],
+ 1
+);
+$email->addTo(
+ "test+test3@example.com",
+ "Example User3",
+ [
+ "subject" => "Subject 3",
+ "name" => "Example User 3",
+ "city" => "Redwood City"
+ ],
+ 2
+);
+$email->setTemplateId("d-13b8f94fbcae4ec6b75270d6cb59f932");
+$sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
+try {
+ $response = $sendgrid->send($email);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: '. $e->getMessage(). "\n";
+}
+```
+
+
+# Legacy Templates
+
+For this example, we assume you have created a [legacy transactional template](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html) in the UI or via the API. Following is the template content we used for testing.
+
+Template ID (replace with your own):
+
+```text
+13b8f94f-bcae-4ec6-b752-70d6cb59f932
+```
+
+Email Subject:
+
+```text
+<%subject%>
+```
+
+Template Body:
+
+```html
+
+
+
+
+
+Hello -name-,
+
+I'm glad you are trying out the template feature!
+
+<%body%>
+
+I hope you are having a great day in -city- :)
+
+
+
+```
+
+```php
+/sendgrid-php.php';
+
+use \SendGrid\Mail\From;
+use \SendGrid\Mail\To;
+use \SendGrid\Mail\Subject;
+use \SendGrid\Mail\PlainTextContent;
+use \SendGrid\Mail\HtmlContent;
+use \SendGrid\Mail\Mail;
+
+$from = new From("test@example.com", "Example User");
+$tos = [
+ new To(
+ "test+test1@example.com",
+ "Example User1",
+ [
+ '-name-' => 'Example User 1',
+ '-city-' => 'Denver'
+ ]
+ ),
+ new To(
+ "test+test2@example.com",
+ "Example User2",
+ [
+ '-name-' => 'Example User 2',
+ '-city-' => 'Irvine'
+ ]
+ ),
+ new To(
+ "test+test3@example.com",
+ "Example User3",
+ [
+ '-name-' => 'Example User 3',
+ '-city-' => 'Redwood City'
+ ]
+ )
+];
+$subject = new Subject("I'm replacing the subject tag");
+$plainTextContent = new PlainTextContent(
+ "I'm replacing the **body tag**"
+);
+$htmlContent = new HtmlContent(
+ "I'm replacing the body tag"
+);
+$email = new Mail(
+ $from,
+ $tos,
+ $subject,
+ $plainTextContent,
+ $htmlContent
+);
+$email->setTemplateId("13b8f94f-bcae-4ec6-b752-70d6cb59f932");
+$sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
+try {
+ $response = $sendgrid->send($email);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: '. $e->getMessage(). "\n";
+}
+```
+
+OR
+
+```php
+/sendgrid-php.php';
+
+use SendGrid\Mail\Mail;
+
+$email = new Mail();
+$email->setFrom("test@sendgrid.com", "Example User");
+$email->setSubject("I'm replacing the subject tag");
+$email->addTo(
+ "test+test1@example.com",
+ "Example User1",
+ [
+ "-name-" => "Example User 1",
+ "-city-" => "Denver"
+ ],
+ 0
+);
+$email->addTo(
+ "test+test2@example.com",
+ "Example User2",
+ [
+ "-name-" => "Example User 2",
+ "-city-" => "Denver"
+ ],
+ 1
+);
+$email->addTo(
+ "test+test3@example.com",
+ "Example User3",
+ [
+ "-name-" => "Example User 3",
+ "-city-" => "Redwood City"
+ ],
+ 2
+);
+$email->addContent("text/plain", "I'm replacing the **body tag**");
+$email->addContent("text/html", "I'm replacing the body tag");
+$email->setTemplateId("13b8f94f-bcae-4ec6-b752-70d6cb59f932");
+$sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
+try {
+ $response = $sendgrid->send($email);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: '. $e->getMessage(). "\n";
+}
+```
+
+# Send an Email With Twilio Email (Pilot)
+
+### 1. Obtain a Free Twilio Account
+
+Sign up for a free Twilio account [here](https://www.twilio.com/try-twilio?source=sendgrid-php).
+
+### 2. Set Up Your Environment Variables
+
+The Twilio API allows for authentication using with either an API key/secret or your Account SID/Auth Token. You can create an API key [here](https://twil.io/get-api-key) or obtain your Account SID and Auth Token [here](https://twil.io/console).
+
+Once you have those, follow the steps below based on your operating system.
+
+#### Linux/Mac
+
+```bash
+echo "export TWILIO_API_KEY='YOUR_TWILIO_API_KEY'" > twilio.env
+echo "export TWILIO_API_SECRET='YOUR_TWILIO_API_SECRET'" >> twilio.env
+
+# or
+
+echo "export TWILIO_ACCOUNT_SID='YOUR_TWILIO_ACCOUNT_SID'" > twilio.env
+echo "export TWILIO_AUTH_TOKEN='YOUR_TWILIO_AUTH_TOKEN'" >> twilio.env
+```
+
+Then:
+
+```bash
+echo "twilio.env" >> .gitignore
+source ./twilio.env
+```
+
+#### Windows
+
+Temporarily set the environment variable (accessible only during the current CLI session):
+
+```bash
+set TWILIO_API_KEY=YOUR_TWILIO_API_KEY
+set TWILIO_API_SECRET=YOUR_TWILIO_API_SECRET
+
+: or
+
+set TWILIO_ACCOUNT_SID=YOUR_TWILIO_ACCOUNT_SID
+set TWILIO_AUTH_TOKEN=YOUR_TWILIO_AUTH_TOKEN
+```
+
+Or permanently set the environment variable (accessible in all subsequent CLI sessions):
+
+```bash
+setx TWILIO_API_KEY "YOUR_TWILIO_API_KEY"
+setx TWILIO_API_SECRET "YOUR_TWILIO_API_SECRET"
+
+: or
+
+setx TWILIO_ACCOUNT_SID "YOUR_TWILIO_ACCOUNT_SID"
+setx TWILIO_AUTH_TOKEN "YOUR_TWILIO_AUTH_TOKEN"
+```
+
+### 3. Initialize the Twilio Email Client
+
+```php
+$twilioEmail = new \TwilioEmail(\getenv('TWILIO_API_KEY'), \getenv('TWILIO_API_SECRET'));
+
+// or
+
+$twilioEmail = new \TwilioEmail(\getenv('TWILIO_ACCOUNT_SID'), \getenv('TWILIO_AUTH_TOKEN'));
+```
+
+This client has the same interface as the `SendGrid` client.
+
+# Send an SMS Message
+
+First, follow the above steps for creating a Twilio account and setting up environment variables with the proper credentials.
+
+Then, install the Twilio Helper Library.
+
+```bash
+composer require twilio/sdk
+```
+
+Finally, send a message.
+
+```php
+messages->create(
+ '8881231234', // Text this number
+ [
+ 'from' => '9991231234', // From a valid Twilio number
+ 'body' => 'Hello from Twilio!'
+ ]
+);
+```
+
+For more information, please visit the [Twilio SMS PHP documentation](https://www.twilio.com/docs/sms/quickstart/php).
+
+
+# How to Set up a Domain Authentication
+
+You can find documentation for how to setup a domain authentication via the UI [here](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) and via API [here](USAGE.md#sender-authentication).
+
+Find more information about all of Twilio SendGrid's authentication related documentation [here](https://sendgrid.com/docs/ui/account-and-settings/).
+
+
+# How to View Email Statistics
+
+You can find documentation for how to view your email statistics via the UI [here](https://app.sendgrid.com/statistics) and via API [here](USAGE.md#stats).
+
+Alternatively, we can post events to a URL of your choice via our [Event Webhook](https://sendgrid.com/docs/for-developers/tracking-events/event/) about events that occur as Twilio SendGrid processes your email.
+
+
+# How to Use the Email Activity Feed API
+
+In order to gain access to the Email Activity Feed API, you must [purchase](https://app.sendgrid.com/settings/billing/addons/email_activity) additional email activity history. To learn about Sendgrid's API to download information from the Email Activity feed, get started [here](https://sendgrid.com/docs/API_Reference/Web_API_v3/Tutorials/getting_started_email_activity_api.html).
+
+
+# Deploying to Heroku
+
+Use the button below to instantly setup your own Simple instance for sending email using SendGrid on Heroku.
+
+
+
+
+
+
+# Google App Engine Installation
+
+Google App Engine installations with Composer require the creation of file `php.ini` in the base folder(the same directory as the `app.yaml` file). You can read more about this file [here](https://cloud.google.com/appengine/docs/standard/php/config/php_ini).
+
+The file `php.ini` should contain:
+
+```ini
+google_app_engine.enable_curl_lite = 1
+```
diff --git a/lib/sendgrid-php/composer.lock b/lib/sendgrid-php/composer.lock
new file mode 100644
index 000000000..e45db3dbd
--- /dev/null
+++ b/lib/sendgrid-php/composer.lock
@@ -0,0 +1,2052 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "This file is @generated automatically"
+ ],
+ "content-hash": "b8cdbfd36fe8771e1ec1488c63934b81",
+ "packages": [
+ {
+ "name": "sendgrid/php-http-client",
+ "version": "4.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sendgrid/php-http-client.git",
+ "reference": "ec09bcfccabeb21d69e245a1e1c0e51f2813fc35"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sendgrid/php-http-client/zipball/ec09bcfccabeb21d69e245a1e1c0e51f2813fc35",
+ "reference": "ec09bcfccabeb21d69e245a1e1c0e51f2813fc35",
+ "shasum": ""
+ },
+ "require": {
+ "ext-curl": "*",
+ "ext-json": "*",
+ "ext-mbstring": "*",
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "^2.16",
+ "phpunit/phpunit": "^9",
+ "squizlabs/php_codesniffer": "~2.0"
+ },
+ "suggest": {
+ "composer/ca-bundle": "Including this library will ensure that a valid CA bundle is available for secure connections"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "SendGrid\\": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Matt Bernier",
+ "email": "mbernier@twilio.com"
+ },
+ {
+ "name": "Elmer Thomas",
+ "email": "ethomas@twilio.com"
+ }
+ ],
+ "description": "HTTP REST client, simplified for PHP",
+ "homepage": "http://github.com/sendgrid/php-http-client",
+ "keywords": [
+ "api",
+ "fluent",
+ "http",
+ "rest",
+ "sendgrid"
+ ],
+ "support": {
+ "source": "https://github.com/sendgrid/php-http-client/tree/4.1.1"
+ },
+ "time": "2023-12-14T08:50:59+00:00"
+ },
+ {
+ "name": "starkbank/ecdsa",
+ "version": "0.0.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/starkbank/ecdsa-php.git",
+ "reference": "484bedac47bac4012dc73df91da221f0a66845cb"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/starkbank/ecdsa-php/zipball/484bedac47bac4012dc73df91da221f0a66845cb",
+ "reference": "484bedac47bac4012dc73df91da221f0a66845cb",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "src/ellipticcurve.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "StarkBank",
+ "email": "developers@starkbank.com",
+ "homepage": "https://starkbank.com",
+ "role": "Developer"
+ }
+ ],
+ "description": "fast openSSL-compatible implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA)",
+ "homepage": "https://github.com/starkbank/ecdsa-php",
+ "support": {
+ "issues": "https://github.com/starkbank/ecdsa-php/issues",
+ "source": "https://github.com/starkbank/ecdsa-php/tree/v0.0.5"
+ },
+ "time": "2021-06-06T22:24:49+00:00"
+ }
+ ],
+ "packages-dev": [
+ {
+ "name": "doctrine/instantiator",
+ "version": "2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/instantiator.git",
+ "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
+ "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^8.1"
+ },
+ "require-dev": {
+ "doctrine/coding-standard": "^11",
+ "ext-pdo": "*",
+ "ext-phar": "*",
+ "phpbench/phpbench": "^1.2",
+ "phpstan/phpstan": "^1.9.4",
+ "phpstan/phpstan-phpunit": "^1.3",
+ "phpunit/phpunit": "^9.5.27",
+ "vimeo/psalm": "^5.4"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Marco Pivetta",
+ "email": "ocramius@gmail.com",
+ "homepage": "https://ocramius.github.io/"
+ }
+ ],
+ "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
+ "homepage": "https://www.doctrine-project.org/projects/instantiator.html",
+ "keywords": [
+ "constructor",
+ "instantiate"
+ ],
+ "support": {
+ "issues": "https://github.com/doctrine/instantiator/issues",
+ "source": "https://github.com/doctrine/instantiator/tree/2.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://www.doctrine-project.org/sponsorship.html",
+ "type": "custom"
+ },
+ {
+ "url": "https://www.patreon.com/phpdoctrine",
+ "type": "patreon"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2022-12-30T00:23:10+00:00"
+ },
+ {
+ "name": "myclabs/deep-copy",
+ "version": "1.11.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/myclabs/DeepCopy.git",
+ "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c",
+ "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1 || ^8.0"
+ },
+ "conflict": {
+ "doctrine/collections": "<1.6.8",
+ "doctrine/common": "<2.13.3 || >=3,<3.2.2"
+ },
+ "require-dev": {
+ "doctrine/collections": "^1.6.8",
+ "doctrine/common": "^2.13.3 || ^3.2.2",
+ "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "src/DeepCopy/deep_copy.php"
+ ],
+ "psr-4": {
+ "DeepCopy\\": "src/DeepCopy/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Create deep copies (clones) of your objects",
+ "keywords": [
+ "clone",
+ "copy",
+ "duplicate",
+ "object",
+ "object graph"
+ ],
+ "support": {
+ "issues": "https://github.com/myclabs/DeepCopy/issues",
+ "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1"
+ },
+ "funding": [
+ {
+ "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2023-03-08T13:26:56+00:00"
+ },
+ {
+ "name": "nikic/php-parser",
+ "version": "v5.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/nikic/PHP-Parser.git",
+ "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13",
+ "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13",
+ "shasum": ""
+ },
+ "require": {
+ "ext-ctype": "*",
+ "ext-json": "*",
+ "ext-tokenizer": "*",
+ "php": ">=7.4"
+ },
+ "require-dev": {
+ "ircmaxell/php-yacc": "^0.0.7",
+ "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
+ },
+ "bin": [
+ "bin/php-parse"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "PhpParser\\": "lib/PhpParser"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Nikita Popov"
+ }
+ ],
+ "description": "A PHP parser written in PHP",
+ "keywords": [
+ "parser",
+ "php"
+ ],
+ "support": {
+ "issues": "https://github.com/nikic/PHP-Parser/issues",
+ "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2"
+ },
+ "time": "2024-03-05T20:51:40+00:00"
+ },
+ {
+ "name": "phar-io/manifest",
+ "version": "2.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phar-io/manifest.git",
+ "reference": "54750ef60c58e43759730615a392c31c80e23176"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176",
+ "reference": "54750ef60c58e43759730615a392c31c80e23176",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-libxml": "*",
+ "ext-phar": "*",
+ "ext-xmlwriter": "*",
+ "phar-io/version": "^3.0.1",
+ "php": "^7.2 || ^8.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Heuer",
+ "email": "sebastian@phpeople.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "Developer"
+ }
+ ],
+ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
+ "support": {
+ "issues": "https://github.com/phar-io/manifest/issues",
+ "source": "https://github.com/phar-io/manifest/tree/2.0.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/theseer",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-03T12:33:53+00:00"
+ },
+ {
+ "name": "phar-io/version",
+ "version": "3.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phar-io/version.git",
+ "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
+ "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2 || ^8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Heuer",
+ "email": "sebastian@phpeople.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "Developer"
+ }
+ ],
+ "description": "Library for handling version information and constraints",
+ "support": {
+ "issues": "https://github.com/phar-io/version/issues",
+ "source": "https://github.com/phar-io/version/tree/3.2.1"
+ },
+ "time": "2022-02-21T01:04:05+00:00"
+ },
+ {
+ "name": "phpstan/phpstan",
+ "version": "1.10.67",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpstan/phpstan.git",
+ "reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/16ddbe776f10da6a95ebd25de7c1dbed397dc493",
+ "reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2|^8.0"
+ },
+ "conflict": {
+ "phpstan/phpstan-shim": "*"
+ },
+ "bin": [
+ "phpstan",
+ "phpstan.phar"
+ ],
+ "type": "library",
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "PHPStan - PHP Static Analysis Tool",
+ "keywords": [
+ "dev",
+ "static analysis"
+ ],
+ "support": {
+ "docs": "https://phpstan.org/user-guide/getting-started",
+ "forum": "https://github.com/phpstan/phpstan/discussions",
+ "issues": "https://github.com/phpstan/phpstan/issues",
+ "security": "https://github.com/phpstan/phpstan/security/policy",
+ "source": "https://github.com/phpstan/phpstan-src"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/ondrejmirtes",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/phpstan",
+ "type": "github"
+ }
+ ],
+ "time": "2024-04-16T07:22:02+00:00"
+ },
+ {
+ "name": "phpunit/php-code-coverage",
+ "version": "9.2.31",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
+ "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965",
+ "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-libxml": "*",
+ "ext-xmlwriter": "*",
+ "nikic/php-parser": "^4.18 || ^5.0",
+ "php": ">=7.3",
+ "phpunit/php-file-iterator": "^3.0.3",
+ "phpunit/php-text-template": "^2.0.2",
+ "sebastian/code-unit-reverse-lookup": "^2.0.2",
+ "sebastian/complexity": "^2.0",
+ "sebastian/environment": "^5.1.2",
+ "sebastian/lines-of-code": "^1.0.3",
+ "sebastian/version": "^3.0.1",
+ "theseer/tokenizer": "^1.2.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "suggest": {
+ "ext-pcov": "PHP extension that provides line coverage",
+ "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "9.2-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
+ "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+ "keywords": [
+ "coverage",
+ "testing",
+ "xunit"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
+ "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-02T06:37:42+00:00"
+ },
+ {
+ "name": "phpunit/php-file-iterator",
+ "version": "3.0.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+ "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
+ "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "FilterIterator implementation that filters files based on a list of suffixes.",
+ "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+ "keywords": [
+ "filesystem",
+ "iterator"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
+ "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2021-12-02T12:48:52+00:00"
+ },
+ {
+ "name": "phpunit/php-invoker",
+ "version": "3.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-invoker.git",
+ "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
+ "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "ext-pcntl": "*",
+ "phpunit/phpunit": "^9.3"
+ },
+ "suggest": {
+ "ext-pcntl": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.1-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Invoke callables with a timeout",
+ "homepage": "https://github.com/sebastianbergmann/php-invoker/",
+ "keywords": [
+ "process"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-invoker/issues",
+ "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-09-28T05:58:55+00:00"
+ },
+ {
+ "name": "phpunit/php-text-template",
+ "version": "2.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-text-template.git",
+ "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
+ "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Simple template engine.",
+ "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+ "keywords": [
+ "template"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-text-template/issues",
+ "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-10-26T05:33:50+00:00"
+ },
+ {
+ "name": "phpunit/php-timer",
+ "version": "5.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-timer.git",
+ "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
+ "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Utility class for timing",
+ "homepage": "https://github.com/sebastianbergmann/php-timer/",
+ "keywords": [
+ "timer"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-timer/issues",
+ "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-10-26T13:16:10+00:00"
+ },
+ {
+ "name": "phpunit/phpunit",
+ "version": "9.6.19",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/phpunit.git",
+ "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1a54a473501ef4cdeaae4e06891674114d79db8",
+ "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/instantiator": "^1.3.1 || ^2",
+ "ext-dom": "*",
+ "ext-json": "*",
+ "ext-libxml": "*",
+ "ext-mbstring": "*",
+ "ext-xml": "*",
+ "ext-xmlwriter": "*",
+ "myclabs/deep-copy": "^1.10.1",
+ "phar-io/manifest": "^2.0.3",
+ "phar-io/version": "^3.0.2",
+ "php": ">=7.3",
+ "phpunit/php-code-coverage": "^9.2.28",
+ "phpunit/php-file-iterator": "^3.0.5",
+ "phpunit/php-invoker": "^3.1.1",
+ "phpunit/php-text-template": "^2.0.3",
+ "phpunit/php-timer": "^5.0.2",
+ "sebastian/cli-parser": "^1.0.1",
+ "sebastian/code-unit": "^1.0.6",
+ "sebastian/comparator": "^4.0.8",
+ "sebastian/diff": "^4.0.3",
+ "sebastian/environment": "^5.1.3",
+ "sebastian/exporter": "^4.0.5",
+ "sebastian/global-state": "^5.0.1",
+ "sebastian/object-enumerator": "^4.0.3",
+ "sebastian/resource-operations": "^3.0.3",
+ "sebastian/type": "^3.2",
+ "sebastian/version": "^3.0.2"
+ },
+ "suggest": {
+ "ext-soap": "To be able to generate mocks based on WSDL files",
+ "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage"
+ },
+ "bin": [
+ "phpunit"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "9.6-dev"
+ }
+ },
+ "autoload": {
+ "files": [
+ "src/Framework/Assert/Functions.php"
+ ],
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "The PHP Unit Testing framework.",
+ "homepage": "https://phpunit.de/",
+ "keywords": [
+ "phpunit",
+ "testing",
+ "xunit"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/phpunit/issues",
+ "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.19"
+ },
+ "funding": [
+ {
+ "url": "https://phpunit.de/sponsors.html",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-04-05T04:35:58+00:00"
+ },
+ {
+ "name": "sebastian/cli-parser",
+ "version": "1.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/cli-parser.git",
+ "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b",
+ "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for parsing CLI options",
+ "homepage": "https://github.com/sebastianbergmann/cli-parser",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/cli-parser/issues",
+ "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-02T06:27:43+00:00"
+ },
+ {
+ "name": "sebastian/code-unit",
+ "version": "1.0.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/code-unit.git",
+ "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120",
+ "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Collection of value objects that represent the PHP code units",
+ "homepage": "https://github.com/sebastianbergmann/code-unit",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/code-unit/issues",
+ "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-10-26T13:08:54+00:00"
+ },
+ {
+ "name": "sebastian/code-unit-reverse-lookup",
+ "version": "2.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
+ "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
+ "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Looks up which function or method a line of code belongs to",
+ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
+ "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-09-28T05:30:19+00:00"
+ },
+ {
+ "name": "sebastian/comparator",
+ "version": "4.0.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/comparator.git",
+ "reference": "fa0f136dd2334583309d32b62544682ee972b51a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a",
+ "reference": "fa0f136dd2334583309d32b62544682ee972b51a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3",
+ "sebastian/diff": "^4.0",
+ "sebastian/exporter": "^4.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@2bepublished.at"
+ }
+ ],
+ "description": "Provides the functionality to compare PHP values for equality",
+ "homepage": "https://github.com/sebastianbergmann/comparator",
+ "keywords": [
+ "comparator",
+ "compare",
+ "equality"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/comparator/issues",
+ "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2022-09-14T12:41:17+00:00"
+ },
+ {
+ "name": "sebastian/complexity",
+ "version": "2.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/complexity.git",
+ "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a",
+ "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a",
+ "shasum": ""
+ },
+ "require": {
+ "nikic/php-parser": "^4.18 || ^5.0",
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for calculating the complexity of PHP code units",
+ "homepage": "https://github.com/sebastianbergmann/complexity",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/complexity/issues",
+ "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-12-22T06:19:30+00:00"
+ },
+ {
+ "name": "sebastian/diff",
+ "version": "4.0.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/diff.git",
+ "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc",
+ "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3",
+ "symfony/process": "^4.2 || ^5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
+ }
+ ],
+ "description": "Diff implementation",
+ "homepage": "https://github.com/sebastianbergmann/diff",
+ "keywords": [
+ "diff",
+ "udiff",
+ "unidiff",
+ "unified diff"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/diff/issues",
+ "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-02T06:30:58+00:00"
+ },
+ {
+ "name": "sebastian/environment",
+ "version": "5.1.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/environment.git",
+ "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed",
+ "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "suggest": {
+ "ext-posix": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.1-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides functionality to handle HHVM/PHP environments",
+ "homepage": "http://www.github.com/sebastianbergmann/environment",
+ "keywords": [
+ "Xdebug",
+ "environment",
+ "hhvm"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/environment/issues",
+ "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:03:51+00:00"
+ },
+ {
+ "name": "sebastian/exporter",
+ "version": "4.0.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/exporter.git",
+ "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72",
+ "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3",
+ "sebastian/recursion-context": "^4.0"
+ },
+ "require-dev": {
+ "ext-mbstring": "*",
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@gmail.com"
+ }
+ ],
+ "description": "Provides the functionality to export PHP variables for visualization",
+ "homepage": "https://www.github.com/sebastianbergmann/exporter",
+ "keywords": [
+ "export",
+ "exporter"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/exporter/issues",
+ "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-02T06:33:00+00:00"
+ },
+ {
+ "name": "sebastian/global-state",
+ "version": "5.0.7",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/global-state.git",
+ "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9",
+ "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3",
+ "sebastian/object-reflector": "^2.0",
+ "sebastian/recursion-context": "^4.0"
+ },
+ "require-dev": {
+ "ext-dom": "*",
+ "phpunit/phpunit": "^9.3"
+ },
+ "suggest": {
+ "ext-uopz": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Snapshotting of global state",
+ "homepage": "http://www.github.com/sebastianbergmann/global-state",
+ "keywords": [
+ "global state"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/global-state/issues",
+ "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-02T06:35:11+00:00"
+ },
+ {
+ "name": "sebastian/lines-of-code",
+ "version": "1.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/lines-of-code.git",
+ "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5",
+ "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5",
+ "shasum": ""
+ },
+ "require": {
+ "nikic/php-parser": "^4.18 || ^5.0",
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for counting the lines of code in PHP source code",
+ "homepage": "https://github.com/sebastianbergmann/lines-of-code",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/lines-of-code/issues",
+ "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-12-22T06:20:34+00:00"
+ },
+ {
+ "name": "sebastian/object-enumerator",
+ "version": "4.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/object-enumerator.git",
+ "reference": "5c9eeac41b290a3712d88851518825ad78f45c71"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71",
+ "reference": "5c9eeac41b290a3712d88851518825ad78f45c71",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3",
+ "sebastian/object-reflector": "^2.0",
+ "sebastian/recursion-context": "^4.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Traverses array structures and object graphs to enumerate all referenced objects",
+ "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
+ "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-10-26T13:12:34+00:00"
+ },
+ {
+ "name": "sebastian/object-reflector",
+ "version": "2.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/object-reflector.git",
+ "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
+ "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Allows reflection of object attributes, including inherited and non-public ones",
+ "homepage": "https://github.com/sebastianbergmann/object-reflector/",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/object-reflector/issues",
+ "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-10-26T13:14:26+00:00"
+ },
+ {
+ "name": "sebastian/recursion-context",
+ "version": "4.0.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/recursion-context.git",
+ "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1",
+ "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ }
+ ],
+ "description": "Provides functionality to recursively process PHP variables",
+ "homepage": "https://github.com/sebastianbergmann/recursion-context",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/recursion-context/issues",
+ "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:07:39+00:00"
+ },
+ {
+ "name": "sebastian/resource-operations",
+ "version": "3.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/resource-operations.git",
+ "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e",
+ "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides a list of PHP built-in functions that operate on resources",
+ "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
+ "support": {
+ "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-14T16:00:52+00:00"
+ },
+ {
+ "name": "sebastian/type",
+ "version": "3.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/type.git",
+ "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7",
+ "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Collection of value objects that represent the types of the PHP type system",
+ "homepage": "https://github.com/sebastianbergmann/type",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/type/issues",
+ "source": "https://github.com/sebastianbergmann/type/tree/3.2.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:13:03+00:00"
+ },
+ {
+ "name": "sebastian/version",
+ "version": "3.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/version.git",
+ "reference": "c6c1022351a901512170118436c764e473f6de8c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c",
+ "reference": "c6c1022351a901512170118436c764e473f6de8c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that helps with managing the version number of Git-hosted PHP projects",
+ "homepage": "https://github.com/sebastianbergmann/version",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/version/issues",
+ "source": "https://github.com/sebastianbergmann/version/tree/3.0.2"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-09-28T06:39:44+00:00"
+ },
+ {
+ "name": "squizlabs/php_codesniffer",
+ "version": "3.9.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
+ "reference": "267a4405fff1d9c847134db3a3c92f1ab7f77909"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/267a4405fff1d9c847134db3a3c92f1ab7f77909",
+ "reference": "267a4405fff1d9c847134db3a3c92f1ab7f77909",
+ "shasum": ""
+ },
+ "require": {
+ "ext-simplexml": "*",
+ "ext-tokenizer": "*",
+ "ext-xmlwriter": "*",
+ "php": ">=5.4.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4"
+ },
+ "bin": [
+ "bin/phpcbf",
+ "bin/phpcs"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.x-dev"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Greg Sherwood",
+ "role": "Former lead"
+ },
+ {
+ "name": "Juliette Reinders Folmer",
+ "role": "Current lead"
+ },
+ {
+ "name": "Contributors",
+ "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors"
+ }
+ ],
+ "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
+ "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer",
+ "keywords": [
+ "phpcs",
+ "standards",
+ "static analysis"
+ ],
+ "support": {
+ "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues",
+ "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy",
+ "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer",
+ "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/PHPCSStandards",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/jrfnl",
+ "type": "github"
+ },
+ {
+ "url": "https://opencollective.com/php_codesniffer",
+ "type": "open_collective"
+ }
+ ],
+ "time": "2024-03-31T21:03:09+00:00"
+ },
+ {
+ "name": "swaggest/json-diff",
+ "version": "v3.10.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/swaggest/json-diff.git",
+ "reference": "17bfc66b330f46e12a7e574133497a290cd79ba5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/swaggest/json-diff/zipball/17bfc66b330f46e12a7e574133497a290cd79ba5",
+ "reference": "17bfc66b330f46e12a7e574133497a290cd79ba5",
+ "shasum": ""
+ },
+ "require": {
+ "ext-json": "*"
+ },
+ "require-dev": {
+ "phperf/phpunit": "4.8.37"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Swaggest\\JsonDiff\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Viacheslav Poturaev",
+ "email": "vearutop@gmail.com"
+ }
+ ],
+ "description": "JSON diff/rearrange/patch/pointer library for PHP",
+ "support": {
+ "issues": "https://github.com/swaggest/json-diff/issues",
+ "source": "https://github.com/swaggest/json-diff/tree/v3.10.5"
+ },
+ "time": "2023-11-17T11:12:46+00:00"
+ },
+ {
+ "name": "theseer/tokenizer",
+ "version": "1.2.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/theseer/tokenizer.git",
+ "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2",
+ "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-tokenizer": "*",
+ "ext-xmlwriter": "*",
+ "php": "^7.2 || ^8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
+ }
+ ],
+ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
+ "support": {
+ "issues": "https://github.com/theseer/tokenizer/issues",
+ "source": "https://github.com/theseer/tokenizer/tree/1.2.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/theseer",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-03T12:36:25+00:00"
+ }
+ ],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": {
+ "php": ">=7.3",
+ "ext-curl": "*",
+ "ext-json": "*",
+ "ext-mbstring": "*",
+ "ext-openssl": "*"
+ },
+ "platform-dev": [],
+ "plugin-api-version": "2.6.0"
+}
diff --git a/lib/sendgrid-php/examples/accesssettings/accesssettings.php b/lib/sendgrid-php/examples/accesssettings/accesssettings.php
new file mode 100644
index 000000000..a409fe33e
--- /dev/null
+++ b/lib/sendgrid-php/examples/accesssettings/accesssettings.php
@@ -0,0 +1,114 @@
+client->access_settings()->activity()->get(null, $query_params);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Add one or more IPs to the whitelist #
+// POST /access_settings/whitelist #
+
+$request_body = json_decode('{
+ "ips": [
+ {
+ "ip": "192.168.1.1"
+ },
+ {
+ "ip": "192.*.*.*"
+ },
+ {
+ "ip": "192.168.1.3/32"
+ }
+ ]
+}');
+
+try {
+ $response = $sg->client->access_settings()->whitelist()->post($request_body);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Retrieve a list of currently whitelisted IPs #
+// GET /access_settings/whitelist #
+
+try {
+ $response = $sg->client->access_settings()->whitelist()->get();
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Remove one or more IPs from the whitelist #
+// DELETE /access_settings/whitelist #
+
+$request_body = json_decode('{
+ "ids": [
+ 1,
+ 2,
+ 3
+ ]
+}');
+
+try {
+ $response = $sg->client->access_settings()->whitelist()->delete($request_body);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Retrieve a specific whitelisted IP #
+// GET /access_settings/whitelist/{rule_id} #
+
+$rule_id = "test_url_param";
+
+try {
+ $response = $sg->client->access_settings()->whitelist()->_($rule_id)->get();
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Remove a specific IP from the whitelist #
+// DELETE /access_settings/whitelist/{rule_id} #
+
+$rule_id = "test_url_param";
+
+try {
+ $response = $sg->client->access_settings()->whitelist()->_($rule_id)->delete();
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
diff --git a/lib/sendgrid-php/examples/alerts/alerts.php b/lib/sendgrid-php/examples/alerts/alerts.php
new file mode 100644
index 000000000..b9a3a1954
--- /dev/null
+++ b/lib/sendgrid-php/examples/alerts/alerts.php
@@ -0,0 +1,88 @@
+client->alerts()->post($request_body);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Retrieve all alerts #
+// GET /alerts #
+
+try {
+ $response = $sg->client->alerts()->get();
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Update an alert #
+// PATCH /alerts/{alert_id} #
+
+$request_body = json_decode('{
+ "email_to": "example@example.com"
+}');
+$alert_id = "test_url_param";
+
+try {
+ $response = $sg->client->alerts()->_($alert_id)->patch($request_body);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Retrieve a specific alert #
+// GET /alerts/{alert_id} #
+
+$alert_id = "test_url_param";
+
+try {
+ $response = $sg->client->alerts()->_($alert_id)->get();
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Delete an alert #
+// DELETE /alerts/{alert_id} #
+
+$alert_id = "test_url_param";
+
+try {
+ $response = $sg->client->alerts()->_($alert_id)->delete();
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
diff --git a/lib/sendgrid-php/examples/apikeys/apikeys.php b/lib/sendgrid-php/examples/apikeys/apikeys.php
new file mode 100644
index 000000000..2f33d0fbc
--- /dev/null
+++ b/lib/sendgrid-php/examples/apikeys/apikeys.php
@@ -0,0 +1,116 @@
+client->api_keys()->post($request_body);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Retrieve all API Keys belonging to the authenticated user #
+// GET /api_keys #
+
+$query_params = json_decode('{"limit": 1}');
+
+try {
+ $response = $sg->client->api_keys()->get(null, $query_params);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Update the name & scopes of an API Key #
+// PUT /api_keys/{api_key_id} #
+
+$request_body = json_decode('{
+ "name": "A New Hope",
+ "scopes": [
+ "user.profile.read",
+ "user.profile.update"
+ ]
+}');
+$api_key_id = "test_url_param";
+
+try {
+ $response = $sg->client->api_keys()->_($api_key_id)->put($request_body);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Update API keys #
+// PATCH /api_keys/{api_key_id} #
+
+$request_body = json_decode('{
+ "name": "A New Hope"
+}');
+$api_key_id = "test_url_param";
+
+try {
+ $response = $sg->client->api_keys()->_($api_key_id)->patch($request_body);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Retrieve an existing API Key #
+// GET /api_keys/{api_key_id} #
+
+$api_key_id = "test_url_param";
+
+try {
+ $response = $sg->client->api_keys()->_($api_key_id)->get();
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Delete API keys #
+// DELETE /api_keys/{api_key_id} #
+
+$api_key_id = "test_url_param";
+
+try {
+ $response = $sg->client->api_keys()->_($api_key_id)->delete();
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
diff --git a/lib/sendgrid-php/examples/asm/asm.php b/lib/sendgrid-php/examples/asm/asm.php
new file mode 100644
index 000000000..273dafd87
--- /dev/null
+++ b/lib/sendgrid-php/examples/asm/asm.php
@@ -0,0 +1,245 @@
+client->asm()->groups()->post($request_body);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Retrieve information about multiple suppression groups #
+// GET /asm/groups #
+
+$query_params = json_decode('{"id": 1}');
+
+try {
+ $response = $sg->client->asm()->groups()->get(null, $query_params);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Update a suppression group. #
+// PATCH /asm/groups/{group_id} #
+
+$request_body = json_decode('{
+ "description": "Suggestions for items our users might like.",
+ "id": 103,
+ "name": "Item Suggestions"
+}');
+$group_id = "test_url_param";
+
+try {
+ $response = $sg->client->asm()->groups()->_($group_id)->patch($request_body);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Get information on a single suppression group. #
+// GET /asm/groups/{group_id} #
+
+$group_id = "test_url_param";
+
+try {
+ $response = $sg->client->asm()->groups()->_($group_id)->get();
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Delete a suppression group. #
+// DELETE /asm/groups/{group_id} #
+
+$group_id = "test_url_param";
+
+try {
+ $response = $sg->client->asm()->groups()->_($group_id)->delete();
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Add suppressions to a suppression group #
+// POST /asm/groups/{group_id}/suppressions #
+
+$request_body = json_decode('{
+ "recipient_emails": [
+ "test1@example.com",
+ "test2@example.com"
+ ]
+}');
+$group_id = "test_url_param";
+
+try {
+ $response = $sg->client->asm()->groups()->_($group_id)->suppressions()->post($request_body);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Retrieve all suppressions for a suppression group #
+// GET /asm/groups/{group_id}/suppressions #
+
+$group_id = "test_url_param";
+
+try {
+ $response = $sg->client->asm()->groups()->_($group_id)->suppressions()->get();
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Search for suppressions within a group #
+// POST /asm/groups/{group_id}/suppressions/search #
+
+$request_body = json_decode('{
+ "recipient_emails": [
+ "exists1@example.com",
+ "exists2@example.com",
+ "doesnotexists@example.com"
+ ]
+}');
+$group_id = "test_url_param";
+
+try {
+ $response = $sg->client->asm()->groups()->_($group_id)->suppressions()->search()->post($request_body);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Delete a suppression from a suppression group #
+// DELETE /asm/groups/{group_id}/suppressions/{email} #
+
+$group_id = "test_url_param";
+$email = "test_url_param";
+
+try {
+ $response = $sg->client->asm()->groups()->_($group_id)->suppressions()->_($email)->delete();
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Retrieve all suppressions #
+// GET /asm/suppressions #
+
+
+try {
+ $response = $sg->client->asm()->suppressions()->get();
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Add recipient addresses to the global suppression group. #
+// POST /asm/suppressions/global #
+
+$request_body = json_decode('{
+ "recipient_emails": [
+ "test1@example.com",
+ "test2@example.com"
+ ]
+}');
+
+try {
+ $response = $sg->client->asm()->suppressions()->global()->post($request_body);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Retrieve a Global Suppression #
+// GET /asm/suppressions/global/{email} #
+
+$email = "test_url_param";
+
+try {
+ $response = $sg->client->asm()->suppressions()->global()->_($email)->get();
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Delete a Global Suppression #
+// DELETE /asm/suppressions/global/{email} #
+
+$email = "test_url_param";
+
+try {
+ $response = $sg->client->asm()->suppressions()->global()->_($email)->delete();
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
+
+////////////////////////////////////////////////////
+// Retrieve all suppression groups for an email address #
+// GET /asm/suppressions/{email} #
+
+$email = "test_url_param";
+
+try {
+ $response = $sg->client->asm()->suppressions()->_($email)->get();
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
diff --git a/lib/sendgrid-php/examples/browsers/browsers.php b/lib/sendgrid-php/examples/browsers/browsers.php
new file mode 100644
index 000000000..9e50a994f
--- /dev/null
+++ b/lib/sendgrid-php/examples/browsers/browsers.php
@@ -0,0 +1,23 @@
+client->browsers()->stats()->get(null, $query_params);
+ print $response->statusCode() . "\n";
+ print_r($response->headers());
+ print $response->body() . "\n";
+} catch (Exception $e) {
+ echo 'Caught exception: ', $e->getMessage(), "\n";
+}
diff --git a/lib/sendgrid-php/examples/campaigns/campaigns.php b/lib/sendgrid-php/examples/campaigns/campaigns.php
new file mode 100644
index 000000000..f6768b13f
--- /dev/null
+++ b/lib/sendgrid-php/examples/campaigns/campaigns.php
@@ -0,0 +1,210 @@
+Check out our spring line!