nkamuo/notification-tracker-bundle

[EXPERIMENTAL] Notification and email tracking bundle for Symfony with webhook support - DO NOT USE IN PRODUCTION

v0.11.1 2025-09-22 21:24 UTC

README

โš ๏ธ EXPERIMENTAL - This project is in active development and should not be used in production environments. APIs and features may change without notice.

Automatically track and analyze all emails and notifications sent through Symfony Mailer and Notifier components.

๐ŸŽฏ What This Bundle Does

This bundle automatically captures and tracks notifications sent through:

  • โœ… Symfony Mailer - All emails sent via $mailer->send()
  • โœ… Symfony Notifier - All notifications sent via $notifier->send()
  • โœ… Manual API - Custom notifications via REST API

No code changes required! Just install, configure, and start tracking.

๐Ÿš€ Quick Start

  1. Install: composer require nkamuo/notification-tracker-bundle
  2. Configure: Add to bundles.php
  3. Migrate: Run doctrine:migrations:migrate
  4. Use: Send emails/notifications as normal - they're automatically tracked!

๐Ÿ“š Documentation

๐Ÿ‘‰ START HERE: Complete Documentation

Essential Links

๐Ÿงช Experimental Status

This is an experimental project - use at your own risk:

  • โœ… Core tracking functionality works
  • โš ๏ธ APIs may change without notice
  • ๐Ÿšง Active development in progress
  • ๐Ÿ”ฌ Suitable for testing and evaluation only

๐ŸŽฏ Key Features

  • ๐Ÿ“ง Multi-channel Support: Email, SMS, Slack, Telegram, Push notifications
  • ๐Ÿ”„ Native Symfony Integration: Works seamlessly with Symfony Mailer and Notifier events
  • ๐Ÿ“Š Complete Tracking: Track sent, delivered, opened, clicked, bounced, and failed messages
  • ๐Ÿ”— Webhook Support: Integrate with SendGrid, Twilio, Mailgun, and more
  • ๐Ÿš€ Async Processing: Built-in Symfony Messenger support
  • ๐Ÿ” API Platform Integration: Rich REST API for browsing and managing notifications
  • ๐Ÿ“ˆ Real-time Analytics: Performance metrics and engagement statistics
  • โš™๏ธ Highly Configurable: Environment-based configuration with sensible defaults

๐Ÿ’ป Installation

composer require nkamuo/notification-tracker-bundle

Register the Bundle

If not using Symfony Flex, register the bundle in config/bundles.php:

return [
    // ...
    Nkamuo\NotificationTrackerBundle\NotificationTrackerBundle::class => ['all' => true],
];

Run Migrations

php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate

โš™๏ธ Basic Configuration

Create config/packages/notification_tracker.yaml:

notification_tracker:
    enabled: true
    tracking:
        enabled: true
        track_opens: true
        track_clicks: true

๐Ÿ“Š Usage Examples

Automatic Tracking

The bundle automatically tracks all emails and notifications sent through Symfony's components:

// Emails are automatically tracked
$email = (new Email())
    ->from('hello@example.com')
    ->to('you@example.com')
    ->subject('Time for Symfony Mailer!')
    ->html('<p>See Twig integration for better HTML integration!</p>');

$mailer->send($email);

API Access

Browse and manage notifications via API Platform:

# List tracked messages
GET /api/notification-tracker/messages

# Get message details  
GET /api/notification-tracker/messages/{id}

# Retry failed message
POST /api/notification-tracker/messages/{id}/retry

# View analytics
GET /api/notification-tracker/analytics

Console Commands

# Process failed messages
php bin/console notification-tracker:process-failed

# View analytics
php bin/console notification-tracker:analytics

# Clean up old messages
php bin/console notification-tracker:cleanup --days=90

๐Ÿ”— Webhook Setup

Configure your webhook endpoints with your providers:

  • SendGrid: https://your-domain.com/webhooks/notification-tracker/sendgrid
  • Twilio: https://your-domain.com/webhooks/notification-tracker/twilio
  • Mailgun: https://your-domain.com/webhooks/notification-tracker/mailgun

๐Ÿงช Testing

composer test
composer cs-fix
composer phpstan

๐Ÿค Support

For issues and feature requests, please use the GitHub issue tracker.

๐Ÿ“„ License

MIT

Ready to enhance your notification system with comprehensive tracking and analytics? ๐Ÿš€

Check out the complete documentation to get started!