Skip to main content

EoxHooks

Project description

Maintainance Status GitHub Actions Workflow Test Status PyPI - Version

This plugin extends and customizes the edx-platform by leveraging Open edX and Django events to trigger specific actions. Key features include:

  • Post to Webhook URL: Sends data to a specified URL based on the eox-hooks settings.

  • Get Extended Certificate Data: Adds comprehensive certificate information to the webhook request.

  • Trigger Enrollments Creation: Initiates an asynchronous task to enroll users in a list of courses.

  • Trigger Grades Assignment: Propagates grades to a specified course component.

  • Create Enrollments for Program: Enroll users in a predefined list of courses constituting a Course Program.

Installation

  1. Add this plugin in your Tutor config.yml with the OPENEDX_EXTRA_PIP_REQUIREMENTS setting.

    OPENEDX_EXTRA_PIP_REQUIREMENTS:
       - eox-hooks=={{version}}
  2. Save the configuration with tutor config save.

  3. Build the image and launch your platform with tutor local launch.

Usage

Before using eox-hooks, you need to set USE_EOX_HOOKS in True and configure EOX_HOOKS_DEFINITIONS in each tenant or site configuration that wants to use the plugin as follows:

USE_EOX_HOOKS: True
EOX_HOOKS_DEFINITIONS:
{
    "<trigger_event>":
    {
        "action": "<action_name>",
        "config":
        {
            "url": "https://webhook.site",
        },
        "fail_silently": False,
        "module": "<path_to_module>",
    },
}

Where:

  • trigger_event: The name of the event the platform sends and eox-hooks listen, such as post_enrollment. For a detailed list, visit the trigger events examples file.

  • action_name: Specify the name of the action to execute. For example: custom_action. To see the available actions in eox-hooks, visit the default hook actions file.

  • config: Adds more information to the action.

  • fail_silently: Defines what happens if an exception arises while executing the action. If False, then the exception is raised.

  • path_to_module: Path to the module defining the action to execute. For example: eox_hooks.actions.

Example

EOX_HOOKS_DEFINITIONS:
{
    "post_register":
    {
        "action": "post_to_webhook_url",
        "config":
        {
            "fields": { "recipient_email": "user.pii.email" },
            "send_certificate_data": False,
            "url": "https://webhook.site",
        },
        "fail_silently": True,
        "module": "eox_hooks.actions",
    },
}

For more examples visit, the hooks settings example file.

Compatibility Notes

Open edX Release

Version

Juniper

<= 1.0

Koa

> 1.0 < 2.0

Lilac

> 1.0 < 2.0

Maple

>= 2.0 < 3.0

Nutmeg

>= 3.0 < 7.0

Olive

>= 4.0 < 7.0

Palm

>= 5.0 < 7.0

Quince

>= 6.0 < 8.0

Redwood

>= 6.3.0

Sumac

>= 8.0.0

Teak

>= 8.1.0

Ulmo

>= 8.2.0

Verawood

>= 8.4.0

The plugin is configured for the latest release (Teak). The following changes in the plugin settings should be applied to be used for previous releases. Those settings can be changed in eox_hooks/settings/common.py or, for example, in the instance configurations.

🚨 If the release you are looking for is not listed, please note:

  • If the Open edX release is compatible with the current eox-hooks version (see Compatibility Notes), the default configuration is sufficient.

  • If incompatible, you can refer to the README from the relevant version tag for configuration details (e.g., v5.1.0 README).

How to Contribute

Contributions are welcome! See our CONTRIBUTING file for more information – it also contains guidelines for how to maintain high code quality, which will make your contribution more likely to be accepted.

License

This project is licensed under the AGPL-3.0 License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eox_hooks-8.4.0.tar.gz (38.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eox_hooks-8.4.0-py3-none-any.whl (47.5 kB view details)

Uploaded Python 3

File details

Details for the file eox_hooks-8.4.0.tar.gz.

File metadata

  • Download URL: eox_hooks-8.4.0.tar.gz
  • Upload date:
  • Size: 38.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for eox_hooks-8.4.0.tar.gz
Algorithm Hash digest
SHA256 923e6d46fb74b6554f05b0c15c668d5a345f06eb80c3e8b59ce9e0bada926dd0
MD5 5373b088f76c6d752ac821eb81a764d9
BLAKE2b-256 df24f28bf8d115e3330d4fca4016edc79cf31603b5fbb800c4e1d9c5d69e01e5

See more details on using hashes here.

File details

Details for the file eox_hooks-8.4.0-py3-none-any.whl.

File metadata

  • Download URL: eox_hooks-8.4.0-py3-none-any.whl
  • Upload date:
  • Size: 47.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for eox_hooks-8.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0340cd5bc21c8a6402356e843355e33a8db69dd1c62d58b5801aa2b804a1f27c
MD5 7b904e1611f202280be01f419fc278dd
BLAKE2b-256 f620360b70bf0df6c872e7d5000adfd6e8706aa77588bc0e53879fdc9d14d1a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page