Пример #1
0
    def send_secret(self):
        # mail template
        subject = utils.render_template_raw(
            'email/secret/subject', {'account': self}, type='txt').strip()
        body = utils.render_template_raw(
            'email/secret/body',
            {
                'account': self,
                'url_prefix': settings.SMART_UI_SERVER_LOCATION,
                'from_name': settings.EMAIL_SUPPORT_NAME,
                'from_email': settings.EMAIL_SUPPORT_ADDRESS,
                'full_name': self.full_name or self.contact_email
            },
            type='txt'
        )

        utils.send_mail(
            subject,
            body,
            "\"%s\" <%s>" % (
                settings.EMAIL_SUPPORT_NAME,
                settings.EMAIL_SUPPORT_ADDRESS
            ),
            ["\"%s\" <%s>" % (
                self.full_name or self.contact_email, self.contact_email)]
        )
Пример #2
0
  def send_welcome_email(self):
    subject = utils.render_template_raw('email/welcome/subject', {'account' : self}, type='txt').strip()
    body = utils.render_template_raw('email/welcome/body', 
                      { 'account'         : self, 
                        'full_name'       : self.full_name or self.contact_email,
                        'url_prefix'      : settings.SMART_UI_SERVER_LOCATION, 
                        'email_support_name'  : settings.EMAIL_SUPPORT_NAME,
                        'email_support_address' : settings.EMAIL_SUPPORT_ADDRESS }, 
                    type='txt')

    utils.send_mail(subject, body, settings.EMAIL_FROM_ADDRESS, [self.contact_email])
Пример #3
0
  def reset_password(self):
    new_password = utils.random_string(10)
    self.password = new_password
    self.save()
  
    # send the mail
    subject = utils.render_template_raw('email/password_reset/subject', {'account': self}, type='txt').strip()
    body = utils.render_template_raw('email/password_reset/body', 
                      { 'account'     : self, 
                        'url_prefix'  : settings.SMART_UI_SERVER_LOCATION, 
                        'new_password'  : new_password}, 
                      type='txt')

    utils.send_mail(subject,body, settings.EMAIL_FROM_ADDRESS, [self.contact_email])
Пример #4
0
    def send_welcome_email(self):
        subject = utils.render_template_raw('email/welcome/subject', {
            'account': self
        },
                                            type='txt').strip()
        body = utils.render_template_raw(
            'email/welcome/body', {
                'account': self,
                'full_name': self.full_name or self.contact_email,
                'url_prefix': settings.SMART_UI_SERVER_LOCATION,
                'email_support_name': settings.EMAIL_SUPPORT_NAME,
                'email_support_address': settings.EMAIL_SUPPORT_ADDRESS
            },
            type='txt')

        utils.send_mail(subject, body, settings.EMAIL_FROM_ADDRESS,
                        [self.contact_email])
Пример #5
0
    def reset_password(self):
        new_password = utils.random_string(10)
        self.password = new_password
        self.save()

        # send the mail
        subject = utils.render_template_raw('email/password_reset/subject', {
            'account': self
        },
                                            type='txt').strip()
        body = utils.render_template_raw('email/password_reset/body', {
            'account': self,
            'url_prefix': settings.SMART_UI_SERVER_LOCATION,
            'new_password': new_password
        },
                                         type='txt')

        utils.send_mail(subject, body, settings.EMAIL_FROM_ADDRESS,
                        [self.contact_email])
Пример #6
0
    def send_secret(self):
        # mail template
        subject = utils.render_template_raw('email/secret/subject', {
            'account': self
        },
                                            type='txt').strip()
        body = utils.render_template_raw(
            'email/secret/body', {
                'account': self,
                'url_prefix': settings.SMART_UI_SERVER_LOCATION,
                'from_name': settings.EMAIL_SUPPORT_NAME,
                'from_email': settings.EMAIL_SUPPORT_ADDRESS,
                'full_name': self.full_name or self.contact_email
            },
            type='txt')

        utils.send_mail(
            subject, body, "\"%s\" <%s>" %
            (settings.EMAIL_SUPPORT_NAME, settings.EMAIL_SUPPORT_ADDRESS), [
                "\"%s\" <%s>" %
                (self.full_name or self.contact_email, self.contact_email)
            ])