A ready-to-use repository that contains real-life use cases for Open edX Events.
One common use case for open edx instances is to connect enrollment and registration events to custom workflows that enhance the user experience. At edunext, we have found that sending this information to Zapier is a very flexible and robust way to achieve this. This repository makes just that very easy. By installing and configuring, it creates receivers for three events:
Name | Type | Description |
---|---|---|
STUDENT_REGISTRATION_COMPLETED | org.openedx.learning.student.registration.completed.v1 | Emitted when the user registration process in the LMS is completed. |
COURSE_ENROLLMENT_CREATED | org.openedx.learning.course.enrollment.created.v1 | Emitted when the user's enrollment process is completed. |
PERSISTENT_GRADE_SUMMARY_CHANGED | org.openedx.learning.course.persistent_grade.summary.v1 | Emitted when a grade changes in the course |
These receivers are configured with:
plugin_app = { "settings_config": { ... }, "signals_config": { "lms.djangoapp": { "relative_path": "receivers", "receivers": [ { "receiver_func_name": "send_user_data_to_webhook", "signal_path": "openedx_events.learning.signals.STUDENT_REGISTRATION_COMPLETED", }, { "receiver_func_name": "send_enrollment_data_to_webhook", "signal_path": "openedx_events.learning.signals.COURSE_ENROLLMENT_CREATED", }, { "receiver_func_name": "send_persistent_grade_course_data_to_webhook", "signal_path": "openedx_events.learning.signals.PERSISTENT_GRADE_SUMMARY_CHANGED", }, ], } }, }
So they can be used out of the box after installing this plugin. Each receiver, formats the data into the serialized dictionary so it's zappier friendly, and then sends it based on the configuration settings.
Checkout receivers.py for implementation details.
For more information, see Open edX Events and Hooks framework.
After installing the plugin, please modify the following settings in common.py or production.py (through env-tokens) with the URL for your own zappier webhook:
ZAPIER_REGISTRATION_WEBHOOK = "https://hooks.zapier.com/hooks/catch/<account>/<webhook>/"
ZAPIER_ENROLLMENT_WEBHOOK = "https://hooks.zapier.com/hooks/catch/<account>/<webhook>/"
Now, you're ready to go.
# Clone the repository git clone [email protected]:edx/openedx-events-2-zapier.git cd openedx-events-2-zapier # Set up a virtualenv using virtualenvwrapper with the same name as the repo and activate it mkvirtualenv -p python3.8 openedx-events-2-zapier
# Activate the virtualenv workon openedx-events-2-zapier # Grab the latest code git checkout master git pull # Install/update the dev requirements make requirements # Run the tests and quality checks (to verify the status before you make any changes) make validate # Make a new branch for your changes git checkout -b <your_github_username>/<short_description> # Using your favorite editor, edit the code to make your change. vim … # Run your new tests pytest ./path/to/new/tests # Run all the tests and quality checks make validate # Commit all your changes git commit … git push # Open a PR and ask for review.
The code in this repository is licensed under the AGPL 3.0 unless otherwise noted.
Please see LICENSE.txt for details.
Contributions are very welcome.
The pull request description template should be automatically applied if you are creating a pull request from GitHub. Otherwise you can find it at PULL_REQUEST_TEMPLATE.md.
The issue report template should be automatically applied if you are creating an issue on GitHub as well. Otherwise you can find it at ISSUE_TEMPLATE.md.
Please do not report security issues in public. Please email [email protected].
This project was written in the context of the Hooks framework for open edx. If you need help with it, the best way forward would be throught the Open edX community at https://discuss.openedx.org where you can connect with both the authors and other users in the community.