Change contact mailing address

Hello,

I am trying to change the contact mailing address that is at the bottom of the emails here:

I found that it resides in /openedx/edx-platform/lms/envs/tutor/production.py in the lms-1 container as part of these contact addresses:

CONTACT_MAILING_ADDRESS = "My Open edX - https://local.openedx.io"
DEFAULT_FROM_EMAIL = ENV_TOKENS.get("DEFAULT_FROM_EMAIL", ENV_TOKENS["CONTACT_EMAIL"])
DEFAULT_FEEDBACK_EMAIL = ENV_TOKENS.get("DEFAULT_FEEDBACK_EMAIL", ENV_TOKENS["CONTACT_EMAIL"])
SERVER_EMAIL = ENV_TOKENS.get("SERVER_EMAIL", ENV_TOKENS["CONTACT_EMAIL"])
...

I tried to change it by adding a patch that would add it to the lms.env.yml but that did not work. Also tried to patch it by adding it to that production.py file but then the platform would not start up. I can replicate that if you think that is the way forward.

Any help would be appreciated!

Hi @tech_mil
As you are seeing the address showing there now is according to the default configuration:

At the bottom of that file there is a patch directive that you should be able to use to overwrite values in this config:
openedx-common-settings

In that way you should be able to overwrite it using a patch plugin like this:

from tutor import hooks

hooks.Filters.ENV_PATCHES.add_item(
    (
        "openedx-common-settings",
        "CONTACT_MAILING_ADDRESS = value"
    )
)

For the value to use, if you wanted for example it to be the same as the DEFAULT_FROM_EMAIL you might do something like this, this will use the DEFAULT_FROM_EMAIL (if it’s set) otherwise fallback to a specific address. You could also just specify the exact value instead of using env token, eg:
CONTACT_MAILING_ADDRESS = "support@mydomain.tld"

from tutor import hooks

hooks.Filters.ENV_PATCHES.add_item(
    (
        "openedx-common-settings",
        'CONTACT_MAILING_ADDRESS = ENV_TOKENS.get("DEFAULT_FROM_EMAIL", "support@mydomain.tld")'
    )
)