Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[12.x] feat: Add ability to override SendQueuedNotifications job class #55942

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

Open
wants to merge 3 commits into
base: 12.x
Choose a base branch
Loading
from

Conversation

Orrison
Copy link
Contributor

@Orrison Orrison commented Jun 6, 2025

Adds the ability to bind a job to override SendQueuedNotifications in the container.

Often, folks may want to have a lot more control over the Notification sending queued job. Without this change, it is a large amount of effort and overrides to make changes to this job.

Orrison added 2 commits June 5, 2025 23:24
Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
@@ -40,5 +40,7 @@ public function register()
$this->app->alias(
ChannelManager::class, FactoryContract::class
);

$this->app->bind(SendQueuedNotifications::class, SendQueuedNotifications::class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to call bind() to bind a concrete class to itself.

The container can handle it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right, good point. Removed.

Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
@Orrison Orrison requested a review from rodrigopedra June 6, 2025 13:15
Copy link
Contributor

@rodrigopedra rodrigopedra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't approve, but it looks good to me.

@taylorotwell
Copy link
Member

taylorotwell commented Jun 6, 2025

Can you describe your use case a bit more? Please mark as ready for review when done. Thanks!

@taylorotwell taylorotwell marked this pull request as draft June 6, 2025 17:49
@Orrison
Copy link
Contributor Author

Orrison commented Jun 8, 2025

Can you describe your use case a bit more? Please mark as ready for review when done. Thanks!

Of course. Currently, it is possible to configure different job settings, like tries, middleware, etc. for SendQueuedNotifications through different properties and methods on the sent Notification.

This works great per Notification, but when you want to do things globally across all Notifications in the system, it's a little less convenient.
You can create a Trait or base abstract class that you then must ensure all Notifications use.
Or override the ChannelManager and its send method to apply global changes like this: https://github.com/canyongbs/advisingapp/blob/main/app-modules/notification/src/Notifications/ChannelManager.php

Being able to customize the base queued job used gives much more control and convenience over defaults and global changes you want to make to queued Notification sending.

@Orrison Orrison marked this pull request as ready for review June 8, 2025 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.