ISSUE-28: Implement opt-in notifications for user mentions in comments #44
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #28
This pull request adds a built-in, opt-in notification system for user mentions in comments. It introduces configuration options to enable or disable notifications, specify delivery channels, and customize notification behavior. The notification system is extensible, allowing developers to override the default notification class and define custom URL resolvers for comment links. Comprehensive tests are included to validate the notification logic and configuration options.
Opt-in Mention Notifications
notificationsconfiguration section inconfig/commentions.phpto enable mention notifications, select channels (mail,database, etc.), customize mail subject, and override listener/notification classes.SendUserMentionedNotificationlistener for theUserWasMentionedEventin the service provider, conditional on configuration.Notification Delivery and Extensibility
SendUserMentionedNotificationlistener (src/Listeners/SendUserMentionedNotification.php) to send notifications to mentioned users via the configured channels, with support for custom notification classes.UserMentionedInCommentnotification class (src/Notifications/UserMentionedInComment.php) supporting mail, database, and broadcast delivery, and utilizing a configurable comment URL resolver.Config(src/Config.php), allowing custom URLs in notifications.Documentation and Testing
README.mdto document the opt-in notification feature, configuration, and usage of the URL resolver. [1] [2]tests/Notifications/MentionNotificationTest.php).