Skip to content

feat(notifications): send notifications to all post instructors - #3267

Open
faisalahammad wants to merge 1 commit into
gocodebox:devfrom
faisalahammad:fix/375-all-instructors-notifications
Open

feat(notifications): send notifications to all post instructors#3267
faisalahammad wants to merge 1 commit into
gocodebox:devfrom
faisalahammad:fix/375-all-instructors-notifications

Conversation

@faisalahammad

@faisalahammad faisalahammad commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description

Notifications for courses and memberships currently target only the post author, ignoring secondary instructors and assistants stored in the _llms_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, 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-cs exits 0 with no errors on changed files.

Manual test plan:

  1. Global "Send to all instructors"

    • Add a second user as an instructor to a test course.
    • Go to LifterLMS > Settings > Notifications > Enrollment.
    • Enable the new "All Instructors" checkbox under Email recipients.
    • Enrol a student in that course.
    • Result: both the author and the secondary instructor receive the enrolment email.
  2. Per-course override (force off)

    • On the test course, set General > "Send Notifications to All Instructors" to "Do Not Send".
    • Enrol another student in the same course.
    • Result: neither instructor receives the enrolment email, even though the global setting is still on.
  3. Per-course override (force on)

    • Turn the global notification setting off.
    • On a different course, set General > "Send Notifications to All Instructors" to "Send".
    • Enrol a student in that course.
    • Result: the course's instructors receive the enrolment email despite the global off.
  4. Lesson triggered notification

    • Enable "All Instructors" globally for the Lesson Complete notification.
    • Add a secondary instructor to the lesson's parent course.
    • Mark the lesson complete for an enrolled student.
    • Result: both instructors receive the lesson-complete email.
  5. Order triggered notification

    • Enable "All Instructors" globally for Purchase Receipt.
    • Add a secondary instructor to the product (course or membership).
    • Complete a purchase.
    • Result: both instructors receive the purchase receipt.

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

  • New feature (non-breaking change which adds functionality)

Checklist:

  • This PR requires and contains at least one changelog file. (.changelogs/all-instructors-notifications.yml — added / minor)
  • My code has been tested.
  • My code passes all existing automated tests.
  • My code follows the LifterLMS Coding & Documentation Standards.

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
@faisalahammad
faisalahammad requested a review from brianhogg as a code owner July 22, 2026 18:02
@brianhogg brianhogg moved this to Awaiting Review in Development Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Awaiting Review

Development

Successfully merging this pull request may close these issues.

2 participants