Skip to content

Commit

Permalink
fix: added https protocol in email unsubscribe url (#35087)
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadadeeltajamul authored Jul 4, 2024
1 parent a763fd8 commit 89a237b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openedx/core/djangoapps/notifications/email/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ def get_unsubscribe_link(username, patch):
'patch': encrypted_patch
}
relative_url = reverse('preference_update_from_encrypted_username_view', kwargs=kwargs)
return f"{settings.LMS_BASE}{relative_url}"
protocol = 'https://'
if settings.DEBUG:
protocol = 'http://'
return f"{protocol}{settings.LMS_BASE}{relative_url}"


def create_email_template_context(username):
Expand Down

0 comments on commit 89a237b

Please sign in to comment.