Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-7057: Provided Notifications API #1

Conversation

webhdx
Copy link
Contributor

@webhdx webhdx commented Nov 15, 2023

Question Answer
JIRA issue IBX-7057
Type feature
Target eZ Platform version v4.6
BC breaks no
Doc needed yes

NotificationService

It's the core of this feature. It exposes PHP API for sending system and user notifications. It uses symfony/notifier internally but I provided our own abstraction just in case. It offers great flexibility on how Notifications can be delivered. We can route all Admin UI flash messages via specific Notifications API channel and make them appear in the browser OR let users decide if they want specific Admin notification to be also delivered to Slack or e-mail.

Symfony Notifier can also take advantage of the Message Bus and we can send notifications asynchronously, unblocking requests from dealing with SMTP servers or APIs.

ChannelSubscription and SubscriptionResolver

Since we want to offer flexibility and we have a few notification channels already, I made a simple configuration to decide which Notification goes where. Configuration should be only used for system notifications or things from which the user can't opt out. I assume in the future we'll let users subscribe to only specific types of notifications. This is where ChainSubscriptionResolver comes into place - it can resolve subscriptions from multiple resolvers. I have different data sources in mind - i.e. there will be a new Resolver reading subscriptions from User Preferences.

Example configuration

ibexa:
    system:
        default:
            notifications:
                subscriptions:
                    Ibexa\Notifications\Value\Notification\OrderConfirmationNotification:
                        channels:
                            - actito

The configuration is siteaccess aware and single notification can be routed to multiple channels.

Checklist:

  • Provided PR description.
  • Tested the solution manually.
  • Provided automated test coverage.
  • Checked that target branch is set correctly (master for features, the oldest supported for bugs).
  • Asked for a review (ping @ibexa/engineering).

@webhdx webhdx added the Feature New feature request label Nov 15, 2023
@webhdx webhdx self-assigned this Nov 15, 2023
@webhdx webhdx changed the title IBX-7057: Cleaned up package/configuration files IBX-7057: Provided Notifications API Nov 15, 2023
@webhdx webhdx force-pushed the IBX-7057-Create-ibexa/notifications-package-and-main-API-for-sending-notifications branch from 35ef2de to 33d3491 Compare November 15, 2023 12:36
@webhdx webhdx marked this pull request as ready for review November 15, 2023 12:37
composer.json Outdated Show resolved Hide resolved
LICENSE Outdated Show resolved Hide resolved
.github/pull_request_template.md Outdated Show resolved Hide resolved
webhdx and others added 3 commits November 15, 2023 15:25
Co-authored-by: Andrew Longosz <alongosz@users.noreply.github.com>
Co-authored-by: Andrew Longosz <alongosz@users.noreply.github.com>
.github/workflows/backend-ci.yaml Outdated Show resolved Hide resolved
.github/workflows/backend-ci.yaml Outdated Show resolved Hide resolved
.github/workflows/backend-ci.yaml Outdated Show resolved Hide resolved
.github/workflows/backend-ci.yaml Outdated Show resolved Hide resolved
@konradoboza konradoboza requested a review from a team November 15, 2023 15:01
@alongosz alongosz requested a review from a team November 15, 2023 15:09
@konradoboza konradoboza requested a review from a team November 21, 2023 08:22
…onsConfigParser.php

Co-authored-by: Konrad Oboza <konrad.oboza@ibexa.co>
@webhdx webhdx merged commit 1d78feb into main Nov 21, 2023
18 checks passed
@webhdx webhdx deleted the IBX-7057-Create-ibexa/notifications-package-and-main-API-for-sending-notifications branch November 21, 2023 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature request Ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants