saf-t | Norwegian SAF-T Schemas , codelists , testfiles | Frontend Framework library
kandi X-RAY | saf-t Summary
kandi X-RAY | saf-t Summary
Used for publishing of Norwegian SAF-T Schemas, codelists, testfiles etc. See also for further documentation and information.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of saf-t
saf-t Key Features
saf-t Examples and Code Snippets
Community Discussions
Trending Discussions on saf-t
QUESTION
The email sent for resetting password are being displayed as raw HTML content. This is not the case for every users but for significant number of users, this problem arrives.
This is my url for password reset:
...ANSWER
Answered 2019-Jul-19 at 12:30By default, the plain text email template is called registration/password_reset_email.html (which I personally think is confusing as plaintext is not html).
In your case both the email_template_name
(plaintext) and html_email_template
(html email) are using the same template this means if a client cannot use html it will fall back to a plaintext email which contains html syntax.
From the docs:
email_template_name: The full name of a template to use for generating the email with the reset password link. Defaults to registration/password_reset_email.html if not supplied.
html_email_template_name: The full name of a template to use for generating a text/html multipart email with the password reset link. By default, HTML email is not sent.
To resolve this:
- change the name of the html email template to be:
html_password_reset_email.html
- Update the keyword args in your
urls.py
setting thehtml_email_template_name=registration/html_password_reset_email.html
,
This will now send the html email template for clients which can render html and fall back to the plaintext (django default) template for clients which can only render plain text.
Additional information: The source for sending password reset email can be found here: https://github.com/django/django/blob/7f612eda80db1c1c8e502aced54c2062080eae46/django/contrib/auth/forms.py#L247
In short, the variable email_template_name
is used to send a plain text version of the email. If you include the html_email_template_name
, then an additional payload is added to the email; which includes a html email attachment (html_email_template_name
).
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install saf-t
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page