alexlbr/email
Provider-agnostic PHP email library with a simple adapter interface. Includes a SendGrid mailer implementation and a MailerInterface for adding your own providers by creating a Mailer adapter under the Mailer namespace. Install via Composer.
ServiceProvider registration, no config file, or Facade support), requiring manual wiring.psr-4), integration would require manual composer.json tweaks or legacy autoload.php hacks.Mail facade or Mailable classes.mysql_* equivalents).| Risk Area | Severity | Mitigation |
|---|---|---|
| Deprecated Dependencies | Critical | Requires PHP 5.6+ polyfills or forks; may conflict with Laravel’s PHP 8.x. |
| Architectural Mismatch | High | Custom wrapper layer needed; high maintenance overhead. |
| Security Vulnerabilities | High | Must audit for deprecated functions (e.g., create_function, eval). |
| Lack of Testing | Medium | No test suite; integration testing would be manual. |
| Vendor Lock-in | Low | Easy to replace with Laravel’s built-in Mail system if integration fails. |
Mail system (which is actively maintained and feature-rich)?Mail system doesn’t address?spatie/laravel-mailables, laravel-notification-channels) that could replace this functionality?ServiceContainer integration).shouldQueue()).Mailable uses render()).Sent, Failed events).attach() method).Mail::raw() or Mail::send() may suffice.Mailable class should be built instead.Mail facade.// Custom wrapper
class LegacyEmailService {
public function send($to, $subject, $body) {
Mail::raw($body, function($message) use ($to, $subject) {
$message->to($to)->subject($subject);
});
}
}
Mailable classes.// app/Mail/CustomEmail.php
class CustomEmail extends Mailable {
public function build() {
return $this->subject('Hello')->view('emails.custom');
}
}
replace or a separate package to isolate the legacy code.composer.json:
"repositories": [
{ "type": "path", "url": "../vendor/legacy-email" }
],
"require": {
"alexlbr/email": "dev-main"
}
Illuminate\Mail\Mailer).php-imap or php-smtp, ensure these are installed.Mailable to test the approach.Mail facade.MailQueue.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| PHP Version Incompatibility | Deployment failures. | Use Docker/PHP-FPM with legacy PHP version. |
| Email Delivery Failures | User complaints, lost transactions. | Fallback to Laravel’s Mail system. |
| Custom Wrapper Bugs | Silent email drops. | Add logging/retries in the wrapper layer. |
| Laravel Upgrade Breaking Changes | Integration breaks. | Isolate in a monorepo or fork the package. |
How can I help you explore Laravel packages today?