https://github.com/trycourier/courier-php
A PHP package for communicating with the Courier REST API.
https://github.com/trycourier/courier-php
Last synced: 2 months ago
JSON representation
A PHP package for communicating with the Courier REST API.
- Host: GitHub
- URL: https://github.com/trycourier/courier-php
- Owner: trycourier
- License: apache-2.0
- Created: 2021-01-09T06:06:35.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2026-05-27T20:09:52.000Z (2 months ago)
- Last Synced: 2026-05-27T22:08:40.985Z (2 months ago)
- Language: PHP
- Homepage: https://packagist.org/packages/trycourier/courier
- Size: 1.89 MB
- Stars: 15
- Watchers: 16
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Security: SECURITY.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
# Courier PHP SDK
> **Beta**: The PHP SDK is in beta. APIs may change between releases. [Share feedback or report issues on GitHub.](https://github.com/trycourier/courier-php/issues/new)
The Courier PHP SDK provides typed access to the Courier REST API from any PHP 8.1+ application. It uses named parameters for optional arguments and returns strongly typed response objects.
## Installation
Add the Courier repository and package to your `composer.json`:
```json
{
"repositories": [
{
"type": "vcs",
"url": "git@github.com:trycourier/courier-php.git"
}
],
"require": {
"trycourier/courier": "^5.0"
}
}
```
Then run `composer install`. Find the latest version on [GitHub Releases](https://github.com/trycourier/courier-php/releases).
## Quick Start
```php
send->message(
message: [
'to' => ['email' => 'you@example.com'],
'content' => [
'title' => 'Hello from Courier!',
'body' => 'Your first notification, sent with the PHP SDK.',
],
],
);
var_dump($response->requestId);
```
The client reads your API key from the constructor argument. Set `COURIER_API_KEY` in your environment and pass it with `getenv('COURIER_API_KEY')`.
## Documentation
Full documentation: **[courier.com/docs/sdk-libraries/php](https://www.courier.com/docs/sdk-libraries/php/)**
- [Quickstart](https://www.courier.com/docs/getting-started/quickstart/)
- [Send API](https://www.courier.com/docs/platform/sending/send-message/)
- [API Reference](https://www.courier.com/docs/reference/get-started/)