From 17dd8109450eeca1d46ea5dd49448fcd2edb7bcb Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Mon, 19 Jun 2017 12:30:37 +0530 Subject: [PATCH] Now we get dcl_text and dcl support email from settings --- membership/models.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/membership/models.py b/membership/models.py index 8bd9feec..2c8c0ad2 100644 --- a/membership/models.py +++ b/membership/models.py @@ -6,6 +6,7 @@ from django.contrib.auth.hashers import make_password from django.core.validators import RegexValidator from django.contrib.auth.models import User from django.contrib.sites.models import Site +from django.conf import settings from utils.stripe_utils import StripeUtils from utils.mailer import DigitalGlarusRegistrationMailer @@ -82,13 +83,17 @@ class CustomUser(AbstractBaseUser, PermissionsMixin): dg = DigitalGlarusRegistrationMailer(user.validation_slug) dg.send_mail(to=user.email) elif app == 'dcl': + dcl_text = settings.DCL_TEXT + dcl_from_address = settings.DCL_SUPPORT_FROM_ADDRESS user.is_active = False email_data = { - 'subject': _('Activate your Data Center Light account'), - 'from_address': '(Data Center Light) Data Center Light Support ', + 'subject': _('Activate your ' + dcl_text + ' account'), + 'from_address': settings.DCL_SUPPORT_FROM_ADDRESS, 'to': user.email, 'context': {'base_url' : base_url, - 'activation_link' : reverse('hosting:validate', kwargs={'validate_slug': user.validation_slug})}, + 'activation_link' : reverse('hosting:validate', kwargs={'validate_slug': user.validation_slug}), + 'dcl_text' : dcl_text + }, 'template_name': 'user_activation', 'template_path': 'datacenterlight/emails/' }