Skip to content

Improve notifications #16932

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

Merged

Conversation

marcusmoore
Copy link
Collaborator

@marcusmoore marcusmoore commented May 13, 2025

This PR addresses a few issues around checkout/checkin notifications via updates to the CheckoutableListener.

When reviewing this there are some chunks that have been wrapped in if blocks and indented so it might be a good idea to hide whitespace.


This PR adds more tests around notifications to ensure webhooks, alert emails, and emails to users are sent across a variety of category and application configurations.

It might be helpful to see which tests have been added to the tests directory. Taking the tests from this PR and dropping them into the develop branch shows the following failures:

image


Before this PR if an checkout/checkin alert email was set in notification settings, the "CC Email" would receive two emails:

  1. to: user and alert address
  2. to: alert address

With this PR one email is sent:

  1. to: user and cc: alert address

If the user is not going to receive the email the the alert address is promoted to the to address:

  1. to: alert address

Note: I've removed the randomness of the category factory "using a default eula". This removes some test flakiness but also means our seeders no longer seed categories that use the default eula. That is actually more accurate because the settings are not seeded with a default eula.


This PR should address (#16938 and #16897) and might address #16966


What this PR doesn't address and needs to be followed up on:

  • The category edit page automatically checks Send email to user on checkin/checkout when there is a EULA (local or global) being used which means users will always get an email on check in even if that is not the intention by the administrator.

@snipe
Copy link
Member

snipe commented May 14, 2025

If require signature is set in the general settings though, an email will be sent.

Screenshot 2025-05-14 at 2 49 12 PM

@marcusmoore
Copy link
Collaborator Author

If require signature is set in the general settings though, an email will be sent.

@snipe I'm not sure I follow. That doesn't seem to be the case on develop (or this PR's branch).

@marcusmoore marcusmoore changed the title Fixed webhook notifications potentially failing to trigger Improve notifications May 20, 2025
Comment on lines +44 to +60
/**
* Register the listeners for the subscriber.
*
* @param Illuminate\Events\Dispatcher $events
*/
public function subscribe($events)
{
$events->listen(
\App\Events\CheckoutableCheckedIn::class,
'App\Listeners\CheckoutableListener@onCheckedIn'
);

$events->listen(
\App\Events\CheckoutableCheckedOut::class,
'App\Listeners\CheckoutableListener@onCheckedOut'
);
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is pulled up from the middle of the class.

@marcusmoore marcusmoore marked this pull request as ready for review May 20, 2025 23:53
@marcusmoore marcusmoore requested a review from snipe as a code owner May 20, 2025 23:53
@marcusmoore
Copy link
Collaborator Author

@snipe this PR is ready for review.

Thought, regarding your comment above, that is not addressed in this PR.

@snipe snipe merged commit 4b9f442 into grokability:develop May 22, 2025
6 of 8 checks passed
@marcusmoore marcusmoore deleted the fixes/webhook-checkin-checkout-fix branch May 22, 2025 17:09
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.

2 participants