- How do I set up Postmark webhooks to send feedback to my Laravel app?
- Configure Postmark’s webhook settings to send feedback (bounces, complaints, opens, clicks) to your Laravel endpoint, typically `/postmark-feedback`. Ensure the endpoint is publicly accessible or proxied if behind a firewall. The package requires no additional Postmark API setup beyond enabling webhooks.
- Does this package work with Laravel Mailcoach v3.5+ or only specific versions?
- The package is designed for Laravel Mailcoach v3.x and has been tested with recent releases. Always check the package’s `composer.json` for version constraints. If Mailcoach v4.x is released, verify compatibility or consult Spatie’s changelog for updates.
- Can I customize what happens when feedback (e.g., bounces) is processed?
- Yes, the package emits events like `FeedbackProcessed` that you can listen to in Laravel’s `EventServiceProvider`. For example, you can suppress bounced emails by subscribing to the event and updating Mailcoach’s recipient table. Custom callbacks are fully supported.
- What Laravel queue driver should I use for processing Postmark feedback?
- The package relies on Laravel’s queue system for async processing. Use Redis or database queues for reliability, especially in production. Ensure your queue worker (e.g., `php artisan queue:work`) is running and monitored to avoid backlogs.
- How do I test Postmark feedback webhooks in my Laravel tests?
- Mock Postmark webhooks using Laravel’s `Http::fake()` or Pest’s `actingAsWebhook()`. Send test payloads to your `/postmark-feedback` endpoint and assert feedback records appear in Mailcoach’s database. The package includes no built-in test helpers, so you’ll need to craft payloads manually.
- Will duplicate feedback from Postmark retries cause issues?
- The package deduplicates feedback using a `feedback_token` field in the payload. However, race conditions during high-volume retries could still occur. Monitor your `mailcoach_feedback` table for duplicates and consider adding a unique index or custom logic if needed.
- Can I use this package with SendGrid or other email providers instead of Postmark?
- No, this package is specifically built for Postmark’s webhook-based feedback system. Alternatives like SendGrid would require a custom implementation or a different package. Ensure Postmark is your email driver (`MAIL_MAILER=postmark`) in Laravel.
- How do I expose the Postmark feedback endpoint securely if my Laravel app is behind a firewall?
- Use a reverse proxy like Nginx or Cloudflare to forward Postmark’s webhook traffic to your Laravel endpoint. Ensure the proxy validates Postmark’s HMAC signatures (provided in the webhook headers) before forwarding. Avoid exposing Laravel directly to the public internet.
- Does the package include a dashboard or reports for feedback analytics?
- No, the package processes feedback and stores it in Mailcoach’s database but doesn’t include a built-in dashboard. You can extend Mailcoach’s existing reports or build custom views using the `mailcoach_feedback` table. Events like `FeedbackProcessed` can trigger analytics logic.
- What should I do if Postmark’s feedback payload structure changes in the future?
- Monitor Spatie’s release notes for updates to this package. If Postmark’s API changes break compatibility, you may need to fork the package or wait for a Spatie patch. The package’s event system allows you to intercept and transform payloads if needed.