How alexandrebulete/ddd-notification-bundle works
DDD Notification Bundle manages standalone recipients and topic subscriptions, then resolves a notification into one asynchronous delivery per reachable recipient/channel. Recipient registration and subscription administration are available through application commands and a console command; a recipient lookup query supports management. Doctrine repositories persist domain state, while Messenger workers hand deliveries to configured channel senders. The principal notify-to-delivery flow is shown from sampled source and README; only Slack has an implementation in the tree, so other advertised transports are configuration-dependent.
Main entry points: Notifier.php Notification router · DoctrineRecipientRepository.php Recipient repository · DddNotificationBundle.php Bundle wiring · RegisterRecipientHandler.php Recipient commands
Components 23
Entry points
- Subscribe console
src/Infrastructure/Symfony/Command/SubscribeConsoleCommand.php - Recipient commands
src/Application/Command/RegisterRecipient/RegisterRecipientHandler.php - Handle command
src/Application/Command/SetRecipientHandle/SetRecipientHandleHandler.php - Subscription command
src/Application/Command/Subscribe/SubscribeHandler.php - Recipient lookup
src/Application/Query/FindRecipients/FindRecipientsHandler.php
Notification domain
- Notification value
src/Domain/ValueObject/Notification.php - Recipient
src/Domain/Model/Recipient.php - Subscription
src/Domain/Model/Subscription.php - Topic
src/Domain/ValueObject/Topic.php - Channel
src/Domain/ValueObject/Channel.php
Async delivery
- Notification router
src/Application/Service/Notifier.php - Pending delivery
src/Application/Delivery/PendingDelivery.php - Messenger dispatcher
src/Infrastructure/Messenger/MessengerDeliveryDispatcher.php - Delivery message
src/Infrastructure/Messenger/DeliverNotification.php - Delivery handler
src/Infrastructure/Messenger/DeliverNotificationHandler.php - Channel sender port
src/Application/Port/ChannelSenderInterface.php
Infrastructure
- Recipient repository
src/Infrastructure/Doctrine/DoctrineRecipientRepository.php - Subscription repository
src/Infrastructure/Doctrine/DoctrineSubscriptionRepository.php - Slack sender
src/Infrastructure/Channel/SlackChannelSender.php - Bundle wiring
src/DddNotificationBundle.php - ULID generator
src/Infrastructure/Identity/UlidIdentityGenerator.php
Other components
- Notification caller
- Symfony Notifier transport
Connections 26
- Notification caller → Notification router: notifies
- Subscribe console → Recipient commands: dispatches command
src/Infrastructure/Symfony/Command/SubscribeConsoleCommand.php - Subscribe console → Handle command: dispatches command
src/Infrastructure/Symfony/Command/SubscribeConsoleCommand.php - Subscribe console → Subscription command: dispatches command
src/Infrastructure/Symfony/Command/SubscribeConsoleCommand.php - Recipient commands → Recipient: registers
src/Application/Command/RegisterRecipient/RegisterRecipientHandler.php - Recipient commands → Recipient repository: saves
src/Application/Command/RegisterRecipient/RegisterRecipientHandler.php - Recipient commands → ULID generator: generates ID
src/Application/Command/RegisterRecipient/RegisterRecipientHandler.php - Handle command → Recipient: sets handle
src/Application/Command/SetRecipientHandle/SetRecipientHandleHandler.php - Handle command → Recipient repository: loads and saves
src/Application/Command/SetRecipientHandle/SetRecipientHandleHandler.php - Subscription command → Subscription: creates
src/Application/Command/Subscribe/SubscribeHandler.php - Subscription command → Subscription repository: saves
src/Application/Command/Subscribe/SubscribeHandler.php - Subscription command → ULID generator: generates ID
src/Application/Command/Subscribe/SubscribeHandler.php - Recipient lookup → Recipient repository: queries
src/Application/Query/FindRecipients/FindRecipientsHandler.php - Notification router → Subscription repository: finds topic subscribers
src/Application/Service/Notifier.php - Notification router → Recipient repository: loads recipients
src/Application/Service/Notifier.php - Notification router → Pending delivery: creates
src/Application/Service/Notifier.php - Notification router → Messenger dispatcher: dispatches
src/Application/Service/Notifier.php - Messenger dispatcher → Delivery message: queues
src/Infrastructure/Messenger/MessengerDeliveryDispatcher.php - Delivery message → Delivery handler: handles
src/Infrastructure/Messenger/DeliverNotificationHandler.php - Delivery handler → Channel sender port: sends through
src/Infrastructure/Messenger/DeliverNotificationHandler.php - Slack sender → Channel sender port: implements
src/Infrastructure/Channel/SlackChannelSender.php - Slack sender → Symfony Notifier transport: uses
- Bundle wiring → Messenger dispatcher: configures async routing
src/DddNotificationBundle.php - Bundle wiring → Recipient repository: wires service
config/services.php - Bundle wiring → Subscription repository: wires service
config/services.php - Bundle wiring → Slack sender: wires service
config/services.php