Download the PHP package sendlayer/sendlayer-php without Composer
On this page you can find all versions of the php package sendlayer/sendlayer-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sendlayer/sendlayer-php
More information about sendlayer/sendlayer-php
Files in sendlayer/sendlayer-php
Package sendlayer-php
Short Description Official PHP SDK for SendLayer API
License MIT
Informations about the package sendlayer-php
SendLayer PHP SDK
The official PHP SDK for interacting with the SendLayer API, providing a simple and intuitive interface for sending emails, managing webhooks, and retrieving email events.
Features
- Email Sending: Send transactional emails with support for HTML, text, attachments, and advanced options
- Webhook Management: Create, retrieve, and delete webhooks for real-time event notifications
- Event Tracking: Retrieve email events and analytics data
- Error Handling: Comprehensive exception handling with specific error types
- Validation: Built-in validation for email addresses, URLs, and API parameters
- File Attachments: Support for both local and remote file attachments
- Modern PHP: Built with PHP 7.4+ features and PSR-4 autoloading
Installation
Using Composer (Recommended)
Manual Installation
- Download the SDK
- Include the autoloader in your project
- Install dependencies:
composer install
Quick Start
Configuration (Optional)
You can pass additional configuration options when initializing the SDK:
Email Sending
Basic Email
HTML Email
Email with Sender Name
Multiple Recipients
Email with CC and BCC
Email with Attachments
Email with Custom Headers and Tags
Webhook Management
Create a Webhook
Get All Webhooks
Delete a Webhook
Event Tracking
Get All Events
Get Events with Filters
Get Events for Specific Message
Error Handling
The SDK provides specific exception types for different error scenarios:
Exception Types
SendLayerException
: Base exception for all SendLayer errorsSendLayerAuthenticationException
: Invalid API key or authentication issuesSendLayerValidationException
: Invalid parameters or validation errorsSendLayerAPIException
: API-specific errors with status code and response dataSendLayerNotFoundException
: Resource not found (404 errors)SendLayerRateLimitException
: Rate limit exceeded (429 errors)SendLayerInternalServerException
: Server errors (5xx errors)
Supported Events
Webhook Events
bounce
: Email bouncedclick
: Link was clickedopen
: Email was openedunsubscribe
: User unsubscribedcomplaint
: User marked as spamdelivery
: Email was delivered
Event Tracking Events
accepted
: Email was accepted by the serverrejected
: Email was rejecteddelivered
: Email was deliveredopened
: Email was openedclicked
: Link was clickedunsubscribed
: User unsubscribedcomplained
: User marked as spamfailed
: Email delivery failed
Requirements
- PHP 7.4 or higher
- Guzzle HTTP Client 7.0 or higher
- JSON extension
- cURL extension (recommended)
License
This SDK is licensed under the MIT License. See the LICENSE file for details.
Support
For support, please contact:
- Email: [email protected]
- Documentation: https://developers.sendlayer.com
- GitHub Issues: https://github.com/sendlayer/sendlayer-php/issues
Contributing
We welcome contributions! Please see our Contributing Guide for details.
Changelog
See CHANGELOG.md for a list of changes and version history.