spatie/laravel-mailcoach-mailer
Laravel mail driver to send transactional Mailables and Notifications via Mailcoach. Keeps an archive of sent emails, optionally tracks opens/clicks, supports resending from the UI, and lets you use Mailcoach templates with placeholder replacements.
Mail facade, enabling seamless integration of transactional emails (e.g., order confirmations, password resets) into Mailcoach’s platform. This aligns well with Laravel’s built-in mail system, requiring minimal architectural changes.Mail facade). High feasibility for existing Laravel apps..env or config) but assumes the API is stable and rate-limited appropriately.template_id in Laravel mailables. This requires upfront coordination between developers and marketers.MailcoachTransport::failed() events) and alert on spikes.template_id in mailables reduces flexibility if templates change frequently. Risk: Technical debt if Mailcoach’s template system evolves (e.g., dynamic variables).Mailcoach vs. In-App Templates:
Fallback Strategy:
mail.driver priority?Cost vs. Features:
Analytics Integration:
Migration Path:
Mail facade, Mailable classes, and queue system. No additional stack changes required.with() or pre-rendering.Phase 1: Pilot
Phase 2: Full Rollout
Mailable classes to use MailcoachTransport.template_id in mailables)..env:
MAIL_MAILCOACH_API_TOKEN=your_token
MAIL_MAILCOACH_TEMPLATE_ID=123
Phase 3: Analytics & Monitoring
MailcoachTransport::failed()).MAIL_MAILCOACH_TIMEOUT if needed).config/mail.php to add Mailcoach driver:
'mailcoach' => [
'api_token' => env('MAIL_MAILCOACH_API_TOKEN'),
],
MailcoachTransport (or set as default driver).Mailable classes with Mailcoach mock.config/mailcoach.php file) to avoid breaking mailables.env() or vault).template_id in Mailcoach.MAIL_DEBUG in Laravel to log Mailcoach API responses.MailcoachTransport::failed() to capture errors.TransactionalMailerContract) for easier provider swaps.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Mailcoach API downtime | Emails not sent | Fallback to SMTP/SES via mail.driver priority. |
| Template deletion in Mailcoach | Broken mailables | Version-control template IDs; use soft deletes. |
| API rate limiting | Queue backlog | Implement retry logic with jitter. |
| Mailcoach analytics outage | Lost tracking data | Cache analytics locally; sync asynchronously. |
| Template ID mismatch | Emails sent with wrong content | CI/CD validation for template IDs. |
How can I help you explore Laravel packages today?