Skip to content

Commit

Permalink
Send congratulation email after email confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan committed Mar 22, 2023
1 parent fcb1ad9 commit 75685c6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 75685c6

Please sign in to comment.