Skip to content

[BB-1874] Add new email templates

Boros Gábor requested to merge kshitij/bb-1874/emails into new-registration-flow

Created by: xitij2000

This PR adds new email templates and a new email and setup for sending HTML emails. A new email is also added in the email process after instance creation but before the site is fully provisioned.

Testing:

  • Setup email setting in the dev environment
  • Go through the registration process
  • Ensure you get all three emails at the correct time with the correct details.

Optionally, you can temporary add the email templates as templateviews to view them in a browser. The code can then be sent using a tool like https://www.pilotmail.io/ to see if it work in an email client

Sample code to test welcome emails.

def send_welcome_email_test(email: str) -> None:
    """
    Send a test welcome email.
    """
    context = dict(
        user_name="John Doe",
        lms_link="http://my.edx.site",
        studio_link="http://studio.my.edx.site",
        # TODO: add in once implemented
        customise_link="http://ocim.site/customise/",
    )
    html_email_helper(
        template_base_name='emails/welcome_email',
        context=context,
        subject=settings.WELCOME_EMAIL_SUBJECT,
        recipient_list=(email,)
    )

Merge request reports