Utils
Email Utils
- ycms.cms.utils.email_utils.send_activation_mail(user)
Send an activation email to a newly registered user
- Parameters:
user (User) – the newly registered user
- ycms.cms.utils.email_utils.send_mail(subject, email_template_name, html_email_template_name, context, recipient)
Sends welcome email to user with new account.
Making use of
EmailMultiAlternativesto send a multipart email with plain text and html version.- Parameters:
subject (str) – The subject of the email
email_template_name (str) – The template to be used to render the text email
html_email_template_name (str) – The template to be used to render the HTML email
subject – The subject of the email
context (dict) – The template context variables
recipient (str) – The email address of the recipient
Token Generator
This module contains helpers for the account activation process
(also see AccountActivationView).
- class ycms.cms.utils.token_generator.CustomPasswordResetTokenGenerator
Bases:
PasswordResetTokenGeneratorThis token generator is identical to the default password reset token generator of
django.contrib.authwith the exception of the used HMAC salt. This means password reset tokens are no longer accepted for the account activation and vice versa.- key_salt = 'ycms.cms.utils.token_generator.PasswordResetTokenGenerator'