tutor icon indicating copy to clipboard operation
tutor copied to clipboard

Registration emails include incorrect links to example.com

Open regisb opened this issue 3 years ago • 3 comments

Bug description

After account registration, the "Account activation" email includes incorrect links to example.com. See orange boxes here:

Account activation

How to reproduce

  1. Launch a production platform
  2. Create an account
  3. Check the "Sign in" and the logo links in the top right and left corners. Both point to example.com. For instance, on the demo server:

https://example.com/?utm_source=student&utm_medium=email&utm_campaign=accountactivation&utm_content=64354c7b-1cd6-4809-be11-2aeae8cf9f41 https://example.com/dashboard?utm_source=student&utm_medium=email&utm_campaign=accountactivation&utm_content=64354c7b-1cd6-4809-be11-2aeae8cf9f41

Additional context

See the discussion here: https://discuss.overhang.io/t/how-to-change-subscription-email-template/2315

I believe that the "example.com" link comes from the fact that an incorrect Site is loaded to render ACE emails: https://github.com/openedx/edx-platform/blob/b984ac64dc3125c5f3525c6b160668f3f70b37bb/openedx/core/djangoapps/ace_common/templatetags/ace.py#L141 I did not take the time to troubleshoot this issue further, yet.

regisb avatar Jan 19 '22 13:01 regisb

Hi @regisb. I just looked at the edx source and I would like to work on it. just to be sure, I want to share the approach with you. in the base_body.html, it uses {% with_link_tracking homepage_url %} as the link for the image,

https://github.com/openedx/edx-platform/blob/f1d930fb35d0567b603c4a845e1569eb0fa8f426/openedx/core/djangoapps/ace_common/templates/ace_common/edx_ace/common/base_body.html#L81

which it was passed to the template from template_context.py.

https://github.com/openedx/edx-platform/blob/db32ff2cdf678fa8edd12c9da76a76eef0478614/openedx/core/djangoapps/ace_common/template_context.py#L31

it uses marketing_link function to retrieve a value for the key 'Root' from MKTG_URL_LINK_MAP dict.

can we enable marketing email and add LMS_HOST as 'root' there? or should I go deeper?

CodeWithEmad avatar Mar 29 '22 10:03 CodeWithEmad

Looking at

https://github.com/openedx/edx-platform/blob/f1d930fb35d0567b603c4a845e1569eb0fa8f426/openedx/core/djangoapps/ace_common/templates/ace_common/edx_ace/common/base_body.html

hardlinks to assets from sailthru.com? Is that desirable?

Not a good way to not get your mailing classified in the spam box...

insad avatar Mar 29 '22 11:03 insad

Honestly @CodeWithEmad I have no idea. But it seems to me that the error does not come from the <a href="..." value but from <img src="...". It's the source of the image that is causing trouble, not the destination link. So you should investigate how to set the logo_url variable.

@insad this is an issue, but a different one. I reported it here: https://github.com/openedx/build-test-release-wg/issues/148

regisb avatar Mar 31 '22 13:03 regisb