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

Add Notification extender beforeSending method #2533

Merged
merged 7 commits into from
Jan 19, 2021

Conversation

SychO9
Copy link
Member

@SychO9 SychO9 commented Jan 9, 2021

Part of #1891

Changes proposed in this pull request:
This is needed for extensions to be able to prevent certain notifications from being sent.

Just need to figure out what to do for integration tests for this.

Confirmed

  • Backend changes: tests are green (run composer test).

Copy link
Sponsor Member

@askvortsov1 askvortsov1 left a comment

Choose a reason for hiding this comment

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

Would also be nice to see a test for this. Here's what I'm thinking:

  • Have a custom driver that modifies some attr on each user object.
  • Have the beforeSending callback restrict the list of recipients
  • Test that only the desired recipients have been modified

src/Notification/NotificationSyncer.php Outdated Show resolved Hide resolved
@SychO9
Copy link
Member Author

SychO9 commented Jan 10, 2021

I like the tests idea!

tests/integration/extenders/NotificationTest.php Outdated Show resolved Hide resolved
tests/integration/extenders/NotificationTest.php Outdated Show resolved Hide resolved
tests/integration/extenders/NotificationTest.php Outdated Show resolved Hide resolved
@askvortsov1 askvortsov1 merged commit 927ea4e into master Jan 19, 2021
@askvortsov1 askvortsov1 deleted the sm/notification-before-sending-extender branch January 19, 2021 19:40
tariqwalji pushed a commit to giffgaff/flarum-core that referenced this pull request Mar 12, 2021
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.

4 participants