Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Mailcoach Mailgun Setup

Laravel Mailcoach Mailgun Setup Laravel Package

spatie/laravel-mailcoach-mailgun-setup

Prepares a Mailgun account to work with Mailcoach by configuring/processing feedback for email campaigns. Intended for internal use by Mailcoach; usable independently but no official docs or support beyond Mailcoach documentation.

View on GitHub
Deep Wiki
Context7

[READ ONLY] Setup Mailgun for use with Mailcoach

Frequently asked questions about Laravel Mailcoach Mailgun Setup
Does this package work without Mailcoach? If so, how would I adapt it for custom feedback processing?
This package is designed for Mailcoach, but you can repurpose its core logic for custom feedback handling. The package processes Mailgun webhooks (e.g., bounces, clicks) and stores them in a structured format. You’d need to replicate Mailcoach’s feedback models or adapt the package’s `Feedback` logic to fit your own database schema. Start by inspecting the `MailgunFeedback` class and its relationships to understand how data is parsed and stored.
What Laravel versions does this package support, and are there breaking changes between 8.x and 9.x/10.x?
The package is compatible with Laravel 8+ and follows Spatie’s modern conventions, so it should work without issues in Laravel 9 or 10. However, test thoroughly if using newer Laravel features like route/model binding changes or updated queue workers. No major breaking changes are documented, but always check the package’s `composer.json` for PHP version constraints (currently requires PHP 8.0+).
How do I set up Mailgun webhooks to work with this package? What endpoint should I configure in Mailgun’s dashboard?
Configure Mailgun’s webhook to point to your Laravel endpoint at `/mailcoach/mailgun/webhook`. Ensure the webhook URL uses HTTPS and includes the `X-Mailgun-Signature` header for validation. The package expects Mailgun to POST feedback events (e.g., `click`, `bounce`, `complaint`) to this route. If you’re not using Mailcoach, you may need to adjust the route or middleware to bypass Mailcoach-specific checks.
What types of Mailgun events does this package process (e.g., only bounces, or also opens/clicks)? Can I filter specific events?
This package processes Mailgun’s standard feedback events, including bounces, complaints, opens, and clicks. The `MailgunFeedback` model maps these to Mailcoach’s feedback types, but you can extend the logic to handle additional events like unsubscribes or spam reports. Filtering is handled at the Mailgun webhook level—configure your Mailgun events to only send the types you need (e.g., exclude `opens` if irrelevant).
Is there built-in validation for Mailgun’s webhook signatures? How do I ensure security if I’m not using Mailcoach’s default setup?
The package includes signature validation for Mailgun webhooks using the `X-Mailgun-Signature` header, but this relies on Mailcoach’s middleware. If adapting for custom use, verify the signature manually in your webhook route using Mailgun’s public/private key pair. Laravel’s `VerifyCsrfToken` middleware won’t apply here—use a dedicated middleware or library like `spatie/laravel-webhook-client` for additional security layers.
How does this package handle high-volume feedback (e.g., 10,000+ emails/day)? Are there rate-limiting concerns with Mailgun’s API?
The package processes feedback events asynchronously via Laravel queues, which helps manage high volumes. However, you must configure your queue worker (e.g., `queue:work`) to handle the load. Mailgun’s API has rate limits (e.g., 100 requests/second for webhooks), so monitor your queue for delays. If needed, batch feedback processing or use a dedicated queue for Mailgun events to avoid overwhelming your app.
Are there existing tests for this package, or will I need to mock Mailgun’s API for integration testing?
The package includes basic unit tests for its core logic, but integration tests would require mocking Mailgun’s webhook payloads. Use Laravel’s `Http::fake()` or a package like `mockery` to simulate Mailgun requests. Test edge cases like malformed payloads, missing signatures, or duplicate events. For end-to-end testing, consider using Mailgun’s sandbox mode to trigger real feedback events in a staging environment.
What happens if Mailgun’s API changes (e.g., new event format or deprecated endpoints)? Will this package break?
Since this is a lightweight package, API changes from Mailgun could break compatibility if the webhook payload structure or event names change. Monitor Mailgun’s API docs for updates and adjust the `MailgunFeedback` class or webhook handler accordingly. The package lacks official support, so you’ll need to proactively test with Mailgun’s latest API versions. Consider wrapping Mailgun API calls in a service layer for easier future updates.
Can I use this package with a self-hosted Mailgun instance or only Mailgun’s cloud service?
This package works with any Mailgun instance (cloud or self-hosted) as long as the API and webhook endpoints are accessible. Ensure your Mailgun setup supports the same API version (v3) and event formats used by the package. Self-hosted instances may require additional configuration for DNS or SSL, but the package itself doesn’t impose restrictions. Test thoroughly with your specific Mailgun environment.
What are the alternatives to this package if I’m not using Mailcoach? Are there other Laravel packages for Mailgun feedback?
If you’re not using Mailcoach, alternatives include building a custom webhook handler or using packages like `spatie/laravel-webhook-client` to process Mailgun events generically. For Mailgun-specific solutions, consider `mailgun/mailgun-php` (official SDK) or `beberlei/mailgun-bundle` (Symfony-compatible). Laravel’s built-in queue system can also handle feedback processing with minimal code. Evaluate whether you need Mailcoach’s campaign features or just feedback tracking.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport