- What is MandrillBridge, and how does it work with Laravel?
- MandrillBridge is an adapter that connects BenGorUser’s User library with Mandrill’s email API, enabling transactional emails, templates, and tracking directly from your Laravel user models. It requires manual Laravel integration (e.g., service providers) since it’s PHP-first, not Laravel-native. The package abstracts Mandrill’s API calls but lacks built-in support for Laravel’s Mailable classes or queues.
- Does this package support Laravel’s native email features like Mailables or queues?
- No, MandrillBridge does not natively support Laravel’s Mailables or queue workers. You’ll need to manually integrate it with Laravel’s event system or use custom logic to trigger emails via the adapter. For queue support, consider wrapping Mandrill calls in Laravel’s queue jobs yourself.
- Is MandrillBridge compatible with Laravel 8/9, or only older versions?
- The package requires PHP 5.5+, which technically supports Laravel 5.x+. However, it lacks Laravel-specific features (e.g., config publishing, facades) and may need adjustments for newer Laravel versions. Test thoroughly in your environment, especially if using Laravel 8+ with its stricter dependency rules.
- How do I install and configure MandrillBridge in Laravel?
- Install via Composer: `composer require bengor-user/mandrill-bridge`. Since it’s not Laravel-native, you’ll need to create a service provider to bind the adapter to Laravel’s container, publish config for Mandrill API keys, and optionally build a facade for cleaner syntax. Documentation is sparse; refer to BenGorUser’s User library docs for core functionality.
- What happens if I switch from Mandrill to Mailchimp Transactional API?
- Mandrill is deprecated (replaced by Mailchimp in 2019), so this package introduces technical debt. Plan to migrate to Mailchimp’s API or a Laravel-native solution like `spatie/laravel-mailchimp-subscriber`. The adapter’s code would need significant refactoring to support Mailchimp, as the underlying logic is tightly coupled to Mandrill’s deprecated endpoints.
- Can I use MandrillBridge without BenGorUser’s User library?
- No, this package is specifically designed as an adapter for BenGorUser’s User library. If you’re not already using BenGorUser, consider alternatives like Laravel’s built-in Auth system combined with the Mailchimp API or Laravel Notifications, which offer broader compatibility and active maintenance.
- How secure is storing Mandrill API keys with this package?
- The package itself doesn’t handle key storage, so you’ll need to manually secure Mandrill API keys using Laravel’s `.env` file or a dedicated secrets manager. Avoid hardcoding keys in config files or source code. For production, implement key rotation and restrict API access via IP whitelisting or Mandrill’s built-in security features.
- Are there performance concerns with MandrillBridge in production?
- Mandrill’s API calls could introduce latency, especially if sending high volumes of emails. Mitigate this by caching API responses (e.g., using Laravel’s cache system) or batching requests. Test under load in a staging environment to identify bottlenecks, as the adapter doesn’t include built-in optimizations for Laravel’s ecosystem.
- What alternatives exist for Mandrill email integration in Laravel?
- For Laravel, consider Laravel Notifications (supports Mailchimp via `via('mail')`), the official Mailchimp API packages like `spatie/laravel-mailchimp-subscriber`, or direct integration with Mandrill’s deprecated PHP SDK. These alternatives are more actively maintained and Laravel-compatible, avoiding the technical debt of MandrillBridge.
- How do I test MandrillBridge in my Laravel application?
- The package uses PHPSpec, which may require adaptation for PHPUnit. Mock Mandrill’s API responses in your tests using Laravel’s HTTP testing tools or a library like `mockery`. Test edge cases like failed API calls, rate limits, and email template rendering. Since it’s not Laravel-native, focus on integration tests between BenGorUser and the adapter.