예제 #1
0
    def send_email_thankyou(self):
        context = { 
                'inquiry' : self,
        }

        template = EmailTemplate.objects.get(slug='inquiry-thank-you')
        send_using_template(template, context, self.email)
예제 #2
0
def send_admin_email(user):
    admin_email = settings.EMAIL_ADMIN
    context = {
        'user': user,
    }
    template = EmailTemplate.objects.get(slug='admin-new-user-notification')
    send_using_template(template, context, admin_email)
예제 #3
0
    def send_email(self):

        context = {
            'message' : self,
        }
        template = EmailTemplate.objects.get(slug='contact-tutor')
        send_using_template(template, context, self.recipient.email)
예제 #4
0
    def send_email(self):
        host = Site.objects.all()[0].domain
        validation_url = reverse("accounts:validate", args=[self.token])
        context = { 
                'validation_url' : "http://%s%s" % (host, validation_url), 
        }

        template = EmailTemplate.objects.get(slug='welcome-and-validation')
        send_using_template(template, context, self.user.email)
예제 #5
0
    def send_email(self, send_thankyou=True):
        context = { 
                'inquiry' : self,
        }
        bcc = ['*****@*****.**',]
        template = EmailTemplate.objects.get(slug='inquiry')
        send_using_template(template, context, self.company.email, bcc=bcc)

        if send_thankyou:
            self.send_email_thankyou()
예제 #6
0
    def save(self, *args, **kwargs):
        user = User.objects.get(email=self.cleaned_data['email'])

        new_password = hashlib.sha1(str(randint(1,9999))).hexdigest()[0:6]

        user.set_password(new_password)
        user.save()

        context = {
            'new_password': new_password,

        }

        template = EmailTemplate.objects.get(slug='forgot-password')
        send_using_template(template, context, user.email)

        return user