spatie/laravel-mailcoach-sdk
Laravel-friendly PHP SDK for the Mailcoach API (self-hosted v6+ and Mailcoach Cloud). Manage email lists, subscribers, and campaigns; create and send campaigns, send tests, and iterate through paginated endpoints with simple next() calls.
Pros:
EmailList, Subscriber, Campaign), making it easy to extend or customize behavior (e.g., adding domain-specific logic to resources).next(), previous(), total()) simplifies working with large datasets, a common requirement for email marketing tools.Mailcoach facade provides a clean, fluent interface for common operations (e.g., Mailcoach::campaigns(), Mailcoach::createSubscriber()), improving developer experience.Mailcoach::fake() method enables mocking API responses for unit/integration tests, critical for CI/CD pipelines and local development.Cons:
MAILCOACH_API_TOKEN, MAILCOACH_API_ENDPOINT in .env), but sensitive credentials must be securely managed (e.g., using Laravel’s env() or a secrets manager).Mailcoach::fake() be integrated into the test suite? Are there gaps in mocking specific API responses or edge cases?MAILCOACH_API_TOKEN be secured in production (e.g., environment variables, secret managers)? Are there risks of token leakage?Mailcoach::campaigns())..env and config file support aligns with Laravel’s conventions.guzzlehttp/guzzle for HTTP requests (included as a dependency). No additional dependencies are required.composer require spatie/laravel-mailcoach-sdk
php artisan vendor:publish --tag="mailcoach-sdk-config"
.env with MAILCOACH_API_TOKEN and MAILCOACH_API_ENDPOINT.Mailcoach::campaigns() instead of raw Guzzle requests).Subscriber, Campaign) for type safety and consistency.Mailcoach::fake() and integrate into CI pipelines.cURL or allow_url_fopen for HTTP requests (handled by Guzzle).Mailcoach::fake()).MAILCOACH_API_TOKEN and `MAILHow can I help you explore Laravel packages today?