Download the PHP package sendpost/sendpost_php_sdk without Composer
On this page you can find all versions of the php package sendpost/sendpost_php_sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sendpost/sendpost_php_sdk
More information about sendpost/sendpost_php_sdk
Files in sendpost/sendpost_php_sdk
Package sendpost_php_sdk
Short Description Email API and SMTP relay to not just send and measure email sending, but also alert and optimise. We provide you with tools, expertise and support needed to reliably deliver emails to your customers inboxes on time, every time.
License unlicense
Homepage https://github.com/sendpost/sendpost_php_sdk
Informations about the package sendpost_php_sdk
SendPost PHP SDK
The official PHP SDK for SendPost - a powerful email API service for sending transactional and marketing emails with advanced tracking and analytics.
What is SendPost?
SendPost is an email delivery service that helps you:
- Send personalized emails to multiple recipients
- Track email opens and link clicks
- Monitor email performance (delivery rates, bounces, spam complaints)
- Manage sending domains and IP addresses
- Organize email sending with sub-accounts
Requirements
- PHP 8.1 or higher
- Composer (for installation)
- cURL extension
- JSON extension
- mbstring extension
Installation
The SendPost PHP SDK is available on Packagist, making installation quick and easy.
Method 1: Install via Composer (Recommended)
Composer is the recommended way to install the SendPost PHP SDK.
Step 1: Install Composer
If you don't have Composer installed, download it from getcomposer.org.
Step 2: Install the SDK
Run the following command in your project directory:
This will automatically download the SendPost PHP SDK and all its dependencies from Packagist.
Step 3: Include the autoloader
In your PHP file, include the Composer autoloader:
That's it! You're ready to use the SDK.
Method 2: Install from GitHub Repository
If you need to install directly from the GitHub repository (for example, to use a specific branch or version):
Create or edit your composer.json file and add the SendPost SDK repository:
Then run:
Method 3: Manual Installation
If you prefer not to use Composer:
- Download the SDK files from the repository
- Place them in your project directory
- Include the autoloader:
Note: Manual installation requires you to manage dependencies yourself. We strongly recommend using Composer.
Quick Start
Here's a simple example to send your first email:
Getting Your API Key
Before you can send emails, you need an API key:
- Sign up for a SendPost account at app.sendpost.io/register
- Log in to your account
- Navigate to the API Keys section
- Copy your Sub-Account API Key
Important: Keep your API key secure and never commit it to version control. Use environment variables or a configuration file that's excluded from git.
Common Use Cases
Sending a Transactional Email
Transactional emails are triggered by user actions (order confirmations, password resets, etc.):
Sending a Marketing Email
Marketing emails are sent to multiple recipients for campaigns and newsletters:
Adding a Sending Domain
Before sending emails, you need to add and verify your sending domain:
Getting Email Statistics
Monitor your email performance:
Authentication
SendPost uses API keys for authentication. There are two types of API keys:
Sub-Account API Key (X-SubAccount-ApiKey)
Used for most common operations:
- Sending emails
- Managing domains
- Viewing statistics
- Managing suppressions
Account API Key (X-Account-ApiKey)
Used for account-level operations:
- Creating and managing sub-accounts
- Managing IP addresses
- Creating webhooks
- Account-wide statistics
Which key do I need?
- For sending emails and basic operations: Use your Sub-Account API Key
- For managing your account settings: Use your Account API Key
You can find both keys in your SendPost dashboard under API Keys.
Error Handling
Always wrap API calls in try-catch blocks:
Common error codes:
401- Invalid or missing API key403- Resource already exists or insufficient permissions404- Resource not found422- Invalid request data500- Server error
Available API Classes
The SDK provides classes for different operations:
EmailApi- Send emailsDomainApi- Manage sending domainsStatsApi- Get email statisticsSubAccountApi- Manage sub-accountsSuppressionApi- Manage suppression listsWebhookApi- Manage webhooksMessageApi- Retrieve message detailsIPApi- Manage IP addressesIPPoolsApi- Manage IP pools
Complete Example
See the example project for a complete working example that demonstrates:
- Creating sub-accounts
- Setting up webhooks
- Adding domains
- Sending emails
- Retrieving statistics
- Managing IP pools
API Documentation
For detailed API documentation, see:
- Full API Reference
- SendPost API Documentation
- Postman Collection
Testing
Run the test suite:
Support
Need help?
- Email: [email protected]
- Documentation: https://docs.sendpost.io
- Website: https://sendpost.io
- Dashboard: https://app.sendpost.io
- Packagist: https://packagist.org/packages/sendpost/sendpost-php-sdk
License
This SDK is open source. See the LICENSE file for details.
Version
- SDK Version: 1.0.0
- API Version: 1.0.0
- PHP Version: 8.1+
All versions of sendpost_php_sdk with dependencies
ext-curl Version *
ext-json Version *
ext-mbstring Version *
guzzlehttp/guzzle Version ^7.3
guzzlehttp/psr7 Version ^1.7 || ^2.0