From a5c7f7d6f103aafb5c239c5826d0876bd0de7ccb Mon Sep 17 00:00:00 2001 From: Ahtisham Shahid Date: Tue, 25 Nov 2025 13:54:31 +0500 Subject: [PATCH] feat: added new patch to add email settings feat: updated docs for changes --- .gitignore | 6 +++--- README.rst | 14 ++++++++++++++ tutornotifications/patches/lms-env | 1 + tutornotifications/patches/openedx-common-settings | 1 + tutornotifications/plugin.py | 1 + 5 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 tutornotifications/patches/lms-env create mode 100644 tutornotifications/patches/openedx-common-settings diff --git a/.gitignore b/.gitignore index b7faf40..5548863 100644 --- a/.gitignore +++ b/.gitignore @@ -173,7 +173,7 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ +.idea/ # Abstra # Abstra is an AI-powered process automation framework. @@ -182,9 +182,9 @@ cython_debug/ .abstra/ # Visual Studio Code -# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore +# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore -# and can be added to the global gitignore or merged into this file. However, if you prefer, +# and can be added to the global gitignore or merged into this file. However, if you prefer, # you could uncomment the following to ignore the entire vscode folder # .vscode/ diff --git a/README.rst b/README.rst index 9943fba..59906b2 100644 --- a/README.rst +++ b/README.rst @@ -17,6 +17,20 @@ Usage .. code-block:: bash tutor plugins enable notifications +Configuration +************* + +The plugin exposes the following Tutor configuration keys : + - ``NOTIFICATIONS_DEFAULT_FROM_EMAIL`` + - Default: inherits from the platform `CONTACT_EMAIL`. + - Purpose: sets the default "from" address used when sending notification emails. + +.. code-block:: yaml + + NOTIFICATIONS_DEFAULT_FROM_EMAIL: "no-reply@example.org" + +After changing configuration,restart environment so the new environment variable and settings are picked up by the LMS and MFE images. +If you rely on a specific "from" email for outgoing notifications, explicitly set ``NOTIFICATIONS_DEFAULT_FROM_EMAIL`` rather than relying on the platform-wide ``CONTACT_EMAIL``. The email and push notification settings under Account can be enabled/disabled using `NOTIFICATIONS_ENABLE_SHOW_EMAIL_CHANNEL` diff --git a/tutornotifications/patches/lms-env b/tutornotifications/patches/lms-env new file mode 100644 index 0000000..4c430a1 --- /dev/null +++ b/tutornotifications/patches/lms-env @@ -0,0 +1 @@ +NOTIFICATIONS_DEFAULT_FROM_EMAIL: '{{ NOTIFICATIONS_DEFAULT_FROM_EMAIL }}' diff --git a/tutornotifications/patches/openedx-common-settings b/tutornotifications/patches/openedx-common-settings new file mode 100644 index 0000000..fda8c7a --- /dev/null +++ b/tutornotifications/patches/openedx-common-settings @@ -0,0 +1 @@ +NOTIFICATIONS_DEFAULT_FROM_EMAIL = ENV_TOKENS.get("NOTIFICATIONS_DEFAULT_FROM_EMAIL", ENV_TOKENS["CONTACT_EMAIL"]) diff --git a/tutornotifications/plugin.py b/tutornotifications/plugin.py index 5eadefe..49fe7bb 100644 --- a/tutornotifications/plugin.py +++ b/tutornotifications/plugin.py @@ -19,6 +19,7 @@ ("NOTIFICATIONS_VERSION", __version__), ("NOTIFICATIONS_ENABLE_SHOW_EMAIL_CHANNEL", True), ("NOTIFICATIONS_ENABLE_SHOW_PUSH_CHANNEL", False), + ("NOTIFICATIONS_DEFAULT_FROM_EMAIL", "{{ CONTACT_EMAIL }}") ] )