From 75685c69780e89049e7932cd8ba001917db797aa Mon Sep 17 00:00:00 2001 From: Ivan Date: Wed, 22 Mar 2023 23:18:34 +0100 Subject: [PATCH] Send congratulation email after email confirmation --- CHANGELOG.md | 6 ++++++ accounts/views.py | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0abf38..ba0e9fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.0.31] - 2023-03-22 + +### Fixed + +- Send congratulation email after email confirmation [@AivGitHub](https://github.com/AivGitHub/). + ## [0.0.30] - 2023-03-22 ### Fixed diff --git a/accounts/views.py b/accounts/views.py index 2e72da2..f425fc7 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -816,6 +816,23 @@ def get(self, request, *args, **kwargs): user.is_active = True user.save(update_fields=['is_active']) + context = { + 'p_messages': [ + _('Congratulations! You can Sign in now.'), + _('Greetings from %s Family!' % settings.PROJECT_TITLE), + ], + 'url_message': _('Go back Home!'), + 'url': settings.PAYMENT_HOST, + } + html_message = render_to_string('accounts/auth/email_message.html', context=context) + message = strip_tags(html_message) + + user.email_user( + _('Welcome! Please verify your email'), + message, + settings.DEFAULT_FROM_EMAIL, + html_message=html_message + ) return render( request,