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

feat: add course wide notification event for notifications having wider audience #33666

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

saadyousafarbi
Copy link
Contributor

@saadyousafarbi saadyousafarbi commented Nov 7, 2023

INF-1134

Description

Context

This PR introduces a new handler for the new COURSE_NOTIFICATION_REQUESTED event.
The event will be fired whenever a notification is requested for a course-wide audience.
Some examples of notifications that can be requested via this event:

  • Course updates to all verified learners,
  • Marketing updates to all audit learners to upgrade course,
  • Reported content from discussions sent out to all moderators.

The event will contain 2 important components for determining the audience of the notification, course_key (identify the course) and the audience_filters (how to filter the audience within the course).

Working

the audience_filters will be a dict containing keys that represent the type of audience to filter, and the list of values as value to specify type of filter to apply to that specific audience.

The supported audience_filters we have right now are role and enrollment.

Usage of Role filter
{
    ...,
    "audience_filters": {
            "role": ["Moderator"],
        }
}

Notification sent out to all moderators within the specified course.

Usage of Enrollment filter
{
    ...,
    "audience_filters": {
            "enrollment": ["verified", "audit"],
        }
}

Notification sent out to all learner with enrollment mode verified or audit within the specified course.

Combination of filters

We also support combination of filters i.e, we can have multiple filters at the same time. Following is an example:

{
    ...,
    "audience_filters": {
            "enrollment": ["verified"],
            "role": ["Moderator"],
        }
}

This means that we will first fetch the users within course that have the enrollment mode verified and then fetch users with role Moderator.

The notification will be sent out to all verified learners, and moderators within the course.

❗ if the audience_filters is empty (no filter specified), the notification will be sent out to all active enrolled learners within the course.

Followups

  • Separate discussions roles filter and course roles filter
  • Add cohort filter class
  • Use this new handler to handle notification for new_discussion_post and new_question_post

Related PRs

openedx/openedx-events#285

@saadyousafarbi saadyousafarbi changed the title feat: add course wide notification event for notifications having wider audience [WIP] feat: add course wide notification event for notifications having wider audience Nov 8, 2023
@saadyousafarbi saadyousafarbi force-pushed the saad/INF-1134 branch 5 times, most recently from 10d9776 to 858de60 Compare November 21, 2023 09:22
@saadyousafarbi saadyousafarbi changed the title [WIP] feat: add course wide notification event for notifications having wider audience feat: add course wide notification event for notifications having wider audience Nov 21, 2023
@saadyousafarbi saadyousafarbi merged commit fed784a into master Dec 4, 2023
64 checks passed
@saadyousafarbi saadyousafarbi deleted the saad/INF-1134 branch December 4, 2023 10:46
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

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.

5 participants