Change LMS_ROOT_URL for each Microsite in the sending of emails

30 views
Skip to first unread message

Erick Raul Estrada Acosta

unread,
May 20, 2019, 4:27:49 PM5/20/19
to General Open edX discussion
I am trying to send emails, but I have many microsites, then the mail links take the route of my home page and not the microsite from where it is generated, I found that in the aws.py file it mentions the LMS_ROOT_URL of which the links are composed In the email templates, try adding this option in the custom settings of each microsite in the lms.env.json file, but keep taking the data from the main page and not from the microsite configuration.

Any idea how I could solve this?

Thanks a lot.

John Swope

unread,
May 22, 2019, 10:16:11 AM5/22/19
to General Open edX discussion
Hi Erick,
I made a change similar to this, but to take the language of the microsite instead of the LMS_ROOT_URL. But I think most of the same theory should apply. Basically you find how your email template is pulling in the LMS_ROOT_URL, and modify that slightly to use configuration_helpers_.get_value(). So you might end up with something that looks something like this: 
configuration_helpers.get_value('LMS_ROOT_URL', settings.LMS_ROOT_URL)

Which is saying "get my microsite override for LMS_ROOT_URL, and if you can't find it then fall back to my platform LMS_ROOT_URL"

Hopefully that helps a bit!
John

Erick Raul Estrada Acosta

unread,
May 22, 2019, 11:40:14 AM5/22/19
to edx-...@googlegroups.com
Thanks for you response, 

It tries to do what it tells me, but it is never found in the microsite configuration and it ends up having the default configuration. I do not know how I should do to take the configurations of the microsites try using the "settings.MICROSITE_CONFIGURATE ['Name_site'] ['Configuration_name']" and this does work but it is very static and could not be functional for all my microsites.

Have a great day.


--
You received this message because you are subscribed to the Google Groups "General Open edX discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to edx-code+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/64922ee0-853e-4e70-a679-8482a6104fc4%40googlegroups.com.

John Swope

unread,
May 22, 2019, 11:44:16 AM5/22/19
to General Open edX discussion
Hrrm. Second recommendation would be to change the location where you have your microsite configurations. I always put mine in the Django admin panel Site Configuration>Site Configurations. Never tried putting it in lms.env.json. Not sure if that is one of the issues, but worth a shot....
To unsubscribe from this group and stop receiving emails from it, send an email to edx-...@googlegroups.com.

Erick Raul Estrada Acosta

unread,
May 22, 2019, 12:00:57 PM5/22/19
to edx-...@googlegroups.com
Thanks for your quickly response, 

The configuration that I mentioned in django I only have it for a site that is with which I am doing tests have exactly the same in the "Site Configurations" and the "lms.env.json" was practically a copy and paste.

Do you think you should make the same settings in the "Microsite configuration"->"Microsites" section of django? but he asks me for a key which I'm not sure it is or will only be an identifier of the site like this in the "lms.env.json". I don't have nothing in this section of the django.

Thank you very much for your help Jonn.


To unsubscribe from this group and stop receiving emails from it, send an email to edx-code+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/470217c7-2ecf-4664-a31c-3329624382f7%40googlegroups.com.

John Swope

unread,
May 22, 2019, 12:12:56 PM5/22/19
to General Open edX discussion
Depending on your version "Site Configuration" is where you want to be. I think Microsites in Django admin panel is not used. (But possibly this depends on your version, I'm not sure which version uses which exactly). 

I don't think that "Site Configurations" should be an exact copy-paste of lms.env.json. Site configurations sometimes uses different variables, but not in the case of LMS_ROOT_URL I don't think. attaching an image of an example.

SiteConf.png

Erick Raul Estrada Acosta

unread,
May 22, 2019, 12:48:05 PM5/22/19
to edx-...@googlegroups.com
I use this configuration for my microsites, but I never found the configuration name what i wish search with the configuration_helper. I don't know what version is but i found this.
image.png
image.png

To unsubscribe from this group and stop receiving emails from it, send an email to edx-code+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/ecc7511e-2e93-4e70-8dd7-06c7c3b522dc%40googlegroups.com.

John Swope

unread,
May 22, 2019, 1:24:31 PM5/22/19
to General Open edX discussion
Yea, that looks correct to me...
Reply all
Reply to author
Forward
0 new messages