spatie/laravel-mailcoach-sdk
Laravel SDK for the Mailcoach API (self-hosted v6+ and Mailcoach Cloud). Manage email lists, subscribers and campaigns, create and send campaigns, send test emails, and easily iterate paginated API resources with next().
Mailcoach) and Laravel’s service container, making it a seamless fit for Laravel-based applications. The facade pattern aligns with Laravel’s conventions (e.g., Mail, Cache), reducing cognitive overhead for developers.EmailList, Subscriber, Campaign) as PHP objects with CRUD methods (save(), delete()), mirroring Laravel’s Eloquent ORM. This familiarity accelerates development and reduces boilerplate.spatie/laravel-mailcoach-sdk).vendor:publish and .env (API token/endpoint).Mailcoach::fake() for unit tests).send() calls to Laravel queues.spatie/laravel-queueable-middleware).try-catch blocks or use Laravel’s HandleExceptions.Mailcoach::fake() method simplifies unit testing, but integration tests may require a real Mailcoach instance or a local Docker setup (e.g., Mailcoach’s self-hosted Docker image).Mail facade) or augment it (e.g., for newsletters)?$subscriber->unsubscribe()), but ensure your app logs consent timestamps and provides opt-out links.Mailcoach facade integrates with Laravel’s service container, enabling dependency injection (e.g., use Spatie\MailcoachSdk\Facades\Mailcoach)..env and config/ system for API credentials.Mailcoach::fake() integrates with Laravel’s testing tools (Pest, PHPUnit).email_list_uuid) in your app’s DB for local lookups.Mail facade, custom scripts) to identify migration candidates (e.g., newsletters, user onboarding emails).Mailcoach::createSubscriber()).template_uuid for consistency).queue:failed table to monitor SDK-related job failures.Spatie\MailcoachSdk) and doesn’t override Laravel core classes.illuminate/http-guzzle).app/Models/CustomCampaign extends Spatie\MailcoachSdk\Resources\Campaign).Spatie\MailcoachSdk\Mailcoach instance in Laravel’s service provider..env has MAILCOACH_API_TOKEN and MAILCOACH_API_ENDPOINT.php artisan vendor:publish --tag="mailcoach-sdk-config".composer require spatie/laravel-mailcoach-sdk.Mailcoach::createSubscriber().Mailcoach::createCampaign().Mailcoach::fake() to mock API responses.try-catch blocks) to Laravel’s logs/laravel.log.composer update spatie/laravel-mailcoach-sdk)..env and use Laravel’s config() helper to avoid hardcoding.How can I help you explore Laravel packages today?