{"id":18473142,"url":"https://github.com/xedi/library-php-sendgrid","last_synced_at":"2025-07-19T13:32:09.532Z","repository":{"id":35128823,"uuid":"208819381","full_name":"xedi/library-php-sendgrid","owner":"xedi","description":"First Party SendGrid PHP Library","archived":false,"fork":false,"pushed_at":"2022-03-24T13:30:45.000Z","size":156,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-12T23:34:50.780Z","etag":null,"topics":["sendgrid","sendgrid-api-wrapper"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xedi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2019-09-16T14:23:19.000Z","updated_at":"2022-03-24T13:18:24.000Z","dependencies_parsed_at":"2022-08-08T05:15:44.098Z","dependency_job_id":null,"html_url":"https://github.com/xedi/library-php-sendgrid","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/xedi/library-php-sendgrid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xedi%2Flibrary-php-sendgrid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xedi%2Flibrary-php-sendgrid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xedi%2Flibrary-php-sendgrid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xedi%2Flibrary-php-sendgrid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xedi","download_url":"https://codeload.github.com/xedi/library-php-sendgrid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xedi%2Flibrary-php-sendgrid/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265336610,"owners_count":23749193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["sendgrid","sendgrid-api-wrapper"],"created_at":"2024-11-06T10:23:47.305Z","updated_at":"2025-07-19T13:32:09.473Z","avatar_url":"https://github.com/xedi.png","language":"PHP","readme":"[![](https://github.com/xedi/library-php-sendgrid/workflows/Linting/badge.svg)](https://github.com/xedi/library-php-sendgrid/actions)\n[![](https://github.com/xedi/library-php-sendgrid/workflows/Unit%20Testing/badge.svg)](https://github.com/xedi/library-php-sendgrid/actions)\n[![Dependabot Status](https://api.dependabot.com/badges/status?host=github\u0026identifier=208819381)](https://app.dependabot.com/accounts/xedi/repos/208819381)\n[![Packagist](https://img.shields.io/packagist/v/xedi/sendgrid.svg?logo=composer\u0026labelColor=282d33\u0026logoColor=white)](https://packagist.org/packages/xedi/sendgrid)\n\n# Table of Contents\n\n* [Installation](#installation)\n* [Quick Start](#quick-start)\n* [About](#about)\n* [Feature Requests](#feature-requests)\n* [Security Vulnerabilities](#security-vulnerabilities)\n\n\u003ca name=\"Installation\"\u003e\u003c/a\u003e\n# Installation\n\n### Prerequisites\n\n* PHP 7.1+\n* A SendGrid account and [API Key][SENDGRID_API_KEY]\n\n### Install Package\n\nAdd [XEDI][XEDI] SendGrid to your `composer.json` file either manually or using `composer require`.\n\n```json\n{\n    \"require\": {\n        \"xedi/sendgrid\": \"^1\"\n    }\n}\n```\n\n```shell\ncomposer require xedi/sendgrid\n```\n\n**We recommend the later option, let composer do it's thing**\n\n\u003ca name=\"quick-start\"\u003e\u003c/a\u003e\n# Quick Start\n\n```php\n\u003c?php\n    require 'vendor/autoload.php';\n\n    use Xedi\\SendGrid\\Contracts\\Exception as SendGridException;\n    use Xedi\\SendGrid\\SendGrid;\n\n    SendGrid::setClient(\n        SendGrid::getApiClient($api_key)\n    );\n\n    ($mailable = SendGrid::prepareMail())\n        -\u003esetSender('you@email.com', 'Joe Blogs')\n        -\u003esetSubject('Checkout XEDI\\'s SendGrid library!')\n        -\u003eaddTextContent('Hey,\\n\\rI found this great SendGrid library!')\n        -\u003eaddHtmlContent('\u003cbody\u003eHey,\u003cbr/\u003eI found this great SendGrid library!\u003c/body\u003e')\n        -\u003eaddRecipient('john.smith@email.com', 'John Smith');\n\n    try {\n        SendGrid::send($mailable);\n    } catch (SendGridException $exception) {\n        echo 'Caught exception: ' . (string) $exception;\n    }\n```\n\n\u003ca name=\"about\"\u003e\u003c/a\u003e\n# About\n\nThis library uses [SendGrids v3 HTTP API][SENDGRID_API_DOCS]. It builts on some of the limitations of the \"official\" library such as:\n\n* Interacts with cURL directly limiting your ability to intercept requests during tests.\n* Exceptions aren't specific to the returned error.\n\nWe employ [GuzzleHttp][GUZZLEHTTP] to act as our cURL wrapper off-loading responsibility of processing HTTP requests. Guzzle 6 provides a great utility for intercepting HTTP requests made through it's client; for more details [click here][GUZZLEHTTP_TESTING].\n\nSendGrid only returns one error code if there is a problem with your payload! This is because SendGrid's API is not RESTful. Our library will attempt to provide contextual exceptions such as `Xedi\\SendGrid\\Exceptions\\Domain\\SubjectException`, which would be thrown if SendGrid reports an issue with your subject field.\n\nAll exceptions can be identified using our `ExceptionContract` which all exceptions implement.\n\n\u003ca name=\"feature-requests\"\u003e\u003c/a\u003e\n# Feature Requests\n\nThis library was developed for an in-house project, and it's features will grow as our requirements change. **However**, if there is something we don't support please raise a GitHub issue.\n\n\u003ca name=\"security-vulnerabilities\"\u003e\u003c/a\u003e\n# Security Vulnerabilities\n\nWe take security very seriously. If you spot something, please let us know by emailing use at [development@xedi.com][SECURITY_REPORTING_LINK].\n\n\u003c!-- ############################# Reference Links ####################################### --\u003e\n\n[XEDI]: https://xedi.com\n[GUZZLEHTTP]: http://docs.guzzlephp.org\n[GUZZLEHTTP_TESTING]: http://docs.guzzlephp.org/en/stable/testing.html\n[SENDGRID_API_DOCS]: https://sendgrid.com/docs/api-reference/\n[SENDGRID_API_KEY]: https://app.sendgrid.com/settings/api_keys\n[SECURITY_REPORTING_LINK]: mailto:development@xedi.com?subject=Security%20Vulnerability%20Found%20-%20Xedi%2FSendGrid\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxedi%2Flibrary-php-sendgrid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxedi%2Flibrary-php-sendgrid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxedi%2Flibrary-php-sendgrid/lists"}