Hi everyone 👋
I recently built and open-sourced a Laravel package that adds a complete email preference center to your application.
In many apps the only option users have is "unsubscribe from everything."
That often means losing users who only wanted fewer emails, not zero.
This package lets users control exactly what emails they receive and how often.
What it does
- 📬 Smart notification channel – drop-in replacement for
'mail', automatically routes notifications based on user preferences - 🎛️ Self-service preference center UI – ready-to-use Blade interface where users manage email categories and frequency
- 🔗 One-click unsubscribe – RFC 8058 compliant (works with Gmail & Apple Mail)
- 📋 Digest batching – automatic daily or weekly digests
- 🔒 GDPR consent logging – records preference changes with IP, user agent, and timestamp
- 🧩 Polymorphic support – works with any notifiable model, not just
User - ⚡ Flexible category declaration – attribute, interface, or config mapping
Example usage
use Lchris44\EmailPreferenceCenter\Attributes\EmailCategory;
#[EmailCategory('marketing')]
class NewsletterNotification extends Notification
{
public function via(object $notifiable): array
{
return ['email-preferences'];
}
}
The package will automatically check the user's preferences and decide whether to:
- send immediately
- queue to a digest
- skip the notification
Installation
composer require lchris44/laravel-email-preference-center
Links
GitHub: https://github.com/lchris44/laravel-email-preference-center
Documentation: https://darkorchid-spoonbill-752711.hostingersite.com/
I'd love feedback from the community — especially on:
- the API design
- real-world use cases
- features you think are missing
Thanks!
Top comments (0)