I'm trying to send a custom email template with the reset token. But it keeps sending raw HTML no matter what I do. I have previous experience of doing exactly the same thing without any problem with the Django and Django rest framework. Here's how I did it,
urls.py
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('store.urls')),
path('', include('django.contrib.auth.urls')),
]
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
store/urls.py
...
path('password_reset',
auth_views.PasswordResetView.as_view(
template_name='registration/password_reset_form.html',
html_email_template_name='registration/html_password_reset_email.html',
email_template_name = 'registration/password_reset_email.html',
),
name='password_reset'
),
folder structure
...
templates
|-- registration
|-- html_password_reset_email.html
|-- password_reset_email.html
|-- ...
...
Note:
I tried deleting the password_reset_email.html
template after that it sends the default Django email template.
Hoping for any guidance to solve the issue thanks in advance.