Skip to content

feat!: add support for openedx-events#27

Merged
mariajgrimaldi merged 1 commit intomasterfrom
li/ednx/JU-6
Nov 16, 2021
Merged

feat!: add support for openedx-events#27
mariajgrimaldi merged 1 commit intomasterfrom
li/ednx/JU-6

Conversation

@mariajgrimaldi
Copy link
Contributor

@mariajgrimaldi mariajgrimaldi commented Nov 10, 2021

Description
This PR adds support for openedx-events library. Meaning BREAKING CHANGES:

  • Refactor each action so it can receive data attr instead of model instances.
  • Add tests for Open edX Events receiver hook_handler This function didn't change. We just add new tests for each event it receives.
  • Add openedx-events as a dependency.
  • Drop support for Python 3.5 (openedx-events requires >= py3.8)

How to test

  1. Checkout to edunext-platform branch: li/ednx/JU-6
  2. Activate eox-hooks using your tenant settings:
    "USE_EOX_HOOKS": true,
  3. For each event, you can use the existent actions. For example:
    "EOX_HOOKS_DEFINITIONS": {
        "post_certificate_creation": {
            "action": "trigger_grades_assignment",
            "fail_silently": true,
            "module": "eox_hooks.actions"
        },
        "post_certificate_creation_webhook": {
            "action": "post_to_webhook_url",
            "config": {
                "extra_fields": {
                    "email_message": "Something extra."
                },
                "fields": {
                    "name": "certificate.user.pii.name",
                    "recipient_email": "certificate.user.pii.email"
                },
                "send_certificate_data": true,
                "url": "https://webhook.site/cba6a96b-0550-4c84-9547-9e210b425b60"
            },
            "fail_silently": true,
            "module": "eox_hooks.actions"
        },
        "post_enrollment": {
            "action": "trigger_enrollments_creation",
            "fail_silently": false,
            "module": "eox_hooks.actions"
        },
        "post_register": {
            "action": "register_user_to_crm",
            "fail_silently": false,
            "module": "eox_taylor.suits.upc.actions"
        }
    },

Notes:
This PR was first opened against edunext/limonero.master: #26

@mariajgrimaldi mariajgrimaldi requested review from MoisesGSalas and magajh and removed request for magajh November 10, 2021 17:15
@mariajgrimaldi mariajgrimaldi merged commit 84ac859 into master Nov 16, 2021
@Alec4r Alec4r deleted the li/ednx/JU-6 branch June 24, 2022 18:45
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.

3 participants