Mark email as  unconfirmed
425262
def require_email_confirmation(self):
        
        self.email_confirmed = False
        self.email_link = self.generate_hash(50)
        now = datetime.datetime.utcnow()
        self.email_link_expires = now + datetime.timedelta(hours=24)
264471
def cancel_email_change(self):
        
        if not self.email_new:
            return

        self.email_new = None
        self.email_confirmed = True
        self.email_link = None
        self.email_new = None
        self.email_link_expires = None
267135
@POST
  @Path("{id}/email/confirm")
  @PermitAll
  public Response confirmChangeEmail(@PathParam("id") Long userId, EmailRequest request) {
    checkNotNull(userId);
    checkNotNull(request.getToken());

    boolean isSuccess = userService.confirmEmailAddressChangeUsingToken(userId, request.getToken());
    return isSuccess ? Response.noContent().build() : Response.status(Response.Status.BAD_REQUEST).build();
  }
1098396
def confirm_email_with_link(self, link):
        
        user = self.first(email_link=link)
        if not user:
            return False
        elif user and user.email_confirmed:
            return True
        elif user and user.email_link_expired():
            raise x.EmailLinkExpired('Link expired, generate a new one')

        # confirm otherwise
        user.confirm_email()
        db.session.add(user)
        db.session.commit()
        events.email_confirmed_event.send(user)
        return user
921500
def verify_create(self, recipient, params=None):
        """"""
        if params is None: params = {}
        params.update({'recipient': recipient})
        return Verify().load(self.request('verify', 'POST', params))
264773
def _check_email_changed(cls, username, email):
        """"""
        ret = cls.exec_request('user/{}'.format(username), 'get', raise_for_status=True)
        return ret['email'] != email
594404
def send_confirm_email_email(self, user, user_email):
        """"""
        
        # Verify config settings
        if not self.user_manager.USER_ENABLE_EMAIL: return
        if not self.user_manager.USER_ENABLE_CONFIRM_EMAIL: return

        # The confirm_email email is sent to a specific user_email.email or user.email
        email = user_email.email if user_email else user.email

        # Generate a confirm_email_link
        object_id = user_email.id if user_email else user.id
        token = self.user_manager.generate_token(object_id)
        confirm_email_link = url_for('user.confirm_email', token=token, _external=True)

        # Render email from templates and send it via the configured EmailAdapter
        self._render_and_send_email(
            email,
            user,
            self.user_manager.USER_CONFIRM_EMAIL_TEMPLATE,
            confirm_email_link=confirm_email_link,
        )
341418
def _check_reply_pending(self, option):
        """"""
        if not self.telnet_opt_dict.has_key(option):
            self.telnet_opt_dict[option] = TelnetOption()
        return self.telnet_opt_dict[option].reply_pending
1181788
protected function defaultEmailChange()
    {
        $this->user->unconfirmed_email = $this->email;
        /** @var Token $token */
        $token = Yii::createObject([
            'class'   => Token::className(),
            'user_id' => $this->user->id,
            'type'    => Token::TYPE_CONFIRM_NEW_EMAIL,
        ]);
        $token->save(false);
        $this->mailer->sendReconfirmationMessage($this->user, $token);
        Yii::$app->session->setFlash(
            'info',
            Yii::t('user', 'A confirmation message has been sent to your new email address')
        );
    }
951730
def confirm_email(self, request, email_address):
        
        email_address.verified = True
        email_address.set_as_primary(conditional=True)
        email_address.save()
36658
def notify(cls, user_or_email, instance):
        """"""
        return super(InstanceEvent, cls).notify(user_or_email,
                                                object_id=instance.pk)
1258470
function onChangeEmail() {
  var email = $('#changed-email').val();
  activeUser().updateEmail(email).then(function() {
    refreshUserData();
    alertSuccess('Email changed!');
  }, onAuthError);
}
1170342
def mark_all_as_active(self, recipient=None):
        
        assert_soft_delete()
        qset = self.deleted()
        if recipient:
            qset = qset.filter(recipient=recipient)

        return qset.update(deleted=False)
966275
def confirm_email_token_status(token):
    
    expired, invalid, user, token_data = \
        get_token_status(token, 'confirm', 'CONFIRM_EMAIL', return_data=True)
    if not invalid and user:
        user_id, token_email_hash = token_data
        invalid = not verify_hash(token_email_hash, user.email)
    return expired, invalid, user
1334347
def verify_email_for_object(self, email, content_object, email_field_name='email'):
        

        confirmation_key = generate_random_token()

        try:
            confirmation = EmailConfirmation()
            confirmation.content_object = content_object
            confirmation.email_field_name = email_field_name
            confirmation.email = email
            confirmation.confirmation_key = confirmation_key
            confirmation.save()
        except IntegrityError:
            confirmation = EmailConfirmation.objects.get_for_object(content_object, email_field_name)
            confirmation.email = email
            confirmation.confirmation_key = confirmation_key
            confirmation.save(update_fields=['email', 'confirmation_key'])

        confirmation.send()

        return confirmation
380803
def store_sent_mail(self, mail):
        
        if self.sent_box is not None:
            return self.store_mail(self.sent_box, mail)
1333356
def CheckEmails(self, checkTypo=False, fillWrong=True):
        ''''''
        self.wrong_emails = []
        for email in self.emails:
            if self.CheckEmail(email, checkTypo) is False:
                self.wrong_emails.append(email)