feat(notifications): send notifications to all post instructors - #3267
Open
faisalahammad wants to merge 1 commit into
Open
feat(notifications): send notifications to all post instructors#3267faisalahammad wants to merge 1 commit into
faisalahammad wants to merge 1 commit into
Conversation
Notifications for courses and memberships currently target only the post author, ignoring secondary instructors and assistants stored in the _lms_instructors post meta. This adds an 'All Instructors' recipient option on the 11 notifications that previously targeted the author or course author, and a per-course / per-membership override that lets instructors force the setting on or off for a single course or membership regardless of the global admin default. For notifications triggered by a lesson, section, quiz, or order, the related course or membership is resolved by walking the related objects (Lesson::get_course, Quiz::get_course, Order::get_product, etc.) before reading the override meta and the instructor list. Fixes gocodebox#375
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Notifications for courses and memberships currently target only the post author, ignoring secondary instructors and assistants stored in the
_llms_instructorspost meta. This adds an "All Instructors" recipient option on the 11 notifications that previously targeted the author or course author, and a per-course / per-membership override that lets instructors force the setting on or off for a single course or membership regardless of the global admin default.For notifications triggered by a lesson, section, quiz, or order, the related course or membership is resolved by walking the related objects (Lesson::get_course, Quiz::get_course, Section::get_course, Transaction::get_order, Order::get_product) before reading the override meta and the instructor list.
Fixes #375
How has this been tested?
PHPUnit:
vendor/bin/phpunit --filter 'Notification|Instructor'passes: 94 tests, 384 assertions, 0 failures.PHPCS:
composer run-script check-csexits 0 with no errors on changed files.Manual test plan:
Global "Send to all instructors"
Per-course override (force off)
Per-course override (force on)
Lesson triggered notification
Order triggered notification
Environment: WordPress 6.x, PHP 7.4+, LifterLMS dev branch.
Screenshots
n/a (no visible UI changes for end users; the new control matches existing select styling on the Course Options and Membership Settings metaboxes).
Types of changes
Checklist:
.changelogs/all-instructors-notifications.yml— added / minor)