How to change activation email template?

Hi,

I am using Tutor 10.0.10.

I want to change the Activation Email template, I couldn’t find activation_email.txt file in ~/.local/share/tutor/data/openedx/staticfiles/templates/emails directory. I tried adding this file in custom theme but it didn’t work.

Is there any other way to do it ?

Thanks

Hello anshul798,

check this: https://discuss.openedx.org/t/how-to-change-edx-logo-and-sign-in-link-in-password-reset-email/172/3

https://github.com/edx/edx-platform/tree/open-release/juniper.1/common/templates/student/edx_ace/accountactivation/email

I hope it helps

I have looked further into this and found the following:

the templates for the accountactivation and the passwordreset emails both extend a base_body.html template (first line for them both):

{% extends 'ace_common/edx_ace/common/base_body.html' %}

If you create a base_body.html file in this path inside a custom theme it does override the template for the passwordrecovery email, however the activation one does not use it:

lms/templates/ace_common/edx_ace/common/base_body.html

There is only one base_body.html file in the ace_common app directory, and if you edit it, it does affect the activation email.

I am not familiar with django or jinja so I am not sure if it is a bug to be reported or we should add another file to the theme.

Recovery is part of “user_authn” within openedx/core/djangoapps whilst Activation is part of “common”. They have different folder structures.

I’m running into the same issue with Tutor 10.2.2 which uses Juniper.

I’ve followed the suggestion here Import from Opencraft + email template and have added the base_body.html to my custom theme directory lms/templates/ace_common/edx_ace/common/base_body.html.

However, as @juansele mentioned above, this fixes the password reset email, but not the account activation email. The account activation email is still sent with the outdated text and a header with links that go to a test url site.

In my attempts to fix the account activation email, I’ve tried the following to no avail:

  1. adding a common directory to my custom theme at common/templates/student/edx_ace/accountactivation/email/ to customize the body.html and body.txt files.

  2. tried adding the above files to lms/templates/student/edx_ace/accountactivation/email/

  3. tried adding the activation_email.txt file to lms/templates/emails.

There was mention in this post on StackOverflow about needing to purge the mako template directory; however, I can’t find it when I view the docker container using tutor local run lms bash.

Is there a way to edit the files in the docker container and then freeze those changes as an overlay layer? Alternatively, is it possible to access the actual dockerfiles that are used to create the images and modify the files there?

Thanks for any tips on where to look / what to do next.

Is there anybody who have changed a logo in activation email template or have any idea?

@grinx have you tried the solution mentioned by @juansele , add

lms/templates/ace_common/edx_ace/common/base_body.html

in your custom theme directory and add your logo in this file.

I have tested this solution in juniper, it works for both activation and password reset email.

1 Like

Hi @pcliu thank you for your answer. I did the same, but still the EDX logo in the activation email and my custom logo in the password reset email. I don’t know why and how it works, maybe there are some details inside the base_body.html, could your share that with me to match my file and yours. Thank you.

I just copy
./openedx/core/djangoapps/ace_common/templates/ace_common/edx_ace/common/base_body.html in edx-platform into my theme and change the src in header section. @grinx

 {% block header %}
                    <table role="presentation" width="100%" align="left" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td width="70">
                                <a href="{% with_link_tracking homepage_url %}"><img
                                        src="https://mysite.com/logo.png" width="126"
                                        height="40" alt="{% filter force_escape %}{% blocktrans %}Go to {{ platform_name }} Home Page{% endblocktrans %}{% endfilter %}"/></a>
                            </td>
                            <td align="right" style="text-align: {{ LANGUAGE_BIDI|yesno:"left,right" }};">
                                <a class="login" href="{% with_link_tracking dashboard_url %}" style="color: #005686;">{%  trans "Sign In" %}</a>
                            </td>
                        </tr>
                    </table>
{% endblock %}
1 Like