Change user's login email
        :param user: AuthUser
        :param email:
        :return:
329962
def change_email(self, email):
        

        def cb():
            if not utils.is_email_valid(email):
                raise exceptions.AuthError("Email address invalid")
            self.user.change_email(email)
            return email

        return signals.user_update(self, ACTIONS["EMAIL"], cb,
                                   {"email": self.email})
575054
def create_for_user(self, user):
        
        # support passing email address too
        if type(user) is unicode:
            from .profile import Profile as User
            user = User.objects.get(email=user)

        temp_key = token_generator.make_token(user)

        # save it to the password reset model
        password_reset = PasswordReset(user=user, temp_key=temp_key)
        password_reset.save()

        # send the password reset email
        subject = _("Password reset email sent")
        message = render_to_string("profiles/email_messages/password_reset_key_message.txt", {
            "user": user,
            "uid": int_to_base36(user.id),
            "temp_key": temp_key,
            "site_url": settings.SITE_URL,
            "site_name": settings.SITE_NAME
        })
        send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [user.email])

        return password_reset
1258470
function onChangeEmail() {
  var email = $('#changed-email').val();
  activeUser().updateEmail(email).then(function() {
    refreshUserData();
    alertSuccess('Email changed!');
  }, onAuthError);
}
916267
def send_reset_password_email(person):
    """"""
    uid = urlsafe_base64_encode(force_bytes(person.pk)).decode("ascii")
    token = default_token_generator.make_token(person)
    url = '%s/persons/reset/%s/%s/' % (
        settings.REGISTRATION_BASE_URL, uid, token)

    context = CONTEXT.copy()
    context.update({
        'url': url,
        'receiver': person,
    })

    to_email = person.email
    subject, body = render_email('reset_password', context)

    send_mail(subject, body, settings.ACCOUNTS_EMAIL, [to_email])
75637
def change_user_password(user, password):
    
    user.password = hash_password(password)
    _datastore.put(user)
    send_password_changed_notice(user)
    password_changed.send(current_app._get_current_object(),
                          user=user)
139404
def get_user(id=None, username=None, email=None, federated_id=None, provider=None, jwt=None):
    
    if id:
        return _user(models.AuthUser.get(id))
    elif username:
        return _user(models.AuthUser.get_by_username(username))
    elif email:
        return _user(models.AuthUser.get_by_email(email))
    elif federated_id and provider:
        user = models.AuthUserFederation.get_user(provider, federated_id)
        return _user(user) if user else None
    elif jwt:
        pass
189692
def send_activation_email(self, user, profile, password, site):
        
        ctx_dict = { 'password': password, 
                     'site': site, 
                     'activation_key': profile.activation_key,
                     'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS}
                     
        subject = render_to_string(
            'registration/email/emails/password_subject.txt',
            ctx_dict)
        # Email subject *must not* contain newlines
        subject = ''.join(subject.splitlines())
        
        message = render_to_string('registration/email/emails/password.txt',
                                   ctx_dict)
                                   
        try:
            user.email_user(subject, message, settings.DEFAULT_FROM_EMAIL)
        except:
            pass
174491
def send_reset_password_email(self, user, user_email):
        """"""

        # Verify config settings
        if not self.user_manager.USER_ENABLE_EMAIL: return
        assert self.user_manager.USER_ENABLE_FORGOT_PASSWORD

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

        # Generate a reset_password_link
        token = self.user_manager.generate_token(user.id)
        reset_password_link = url_for('user.reset_password', 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_RESET_PASSWORD_EMAIL_TEMPLATE,
            reset_password_link=reset_password_link,
        )
74627
def user(context, name, email):
    """"""
    existing_user = context.obj['store'].user(email)
    if existing_user:
        click.echo(existing_user.to_dict())
    elif name:
        new_user = context.obj['store'].add_user(name, email)
        click.echo(click.style(f"New user added: {email} ({new_user.id})", fg='green'))
    else:
        click.echo(click.style('User not found', fg='yellow'))
508363
def send_password_changed_email(self, user):
        """"""

        # Verify config settings
        if not self.user_manager.USER_ENABLE_EMAIL: return
        if not self.user_manager.USER_SEND_PASSWORD_CHANGED_EMAIL: return

        # Notification emails are sent to the user's primary email address
        user_or_user_email_object = self.user_manager.db_manager.get_primary_user_email_object(user)
        email = user_or_user_email_object.email

        # Render email from templates and send it via the configured EmailAdapter
        self._render_and_send_email(
            email,
            user,
            self.user_manager.USER_PASSWORD_CHANGED_EMAIL_TEMPLATE,
        )
1067465
def email_user(
        self, subject, message, from_email=settings.DEFAULT_FROM_EMAIL, **kwargs
    ):
        
        receiver = self.email
        if settings.EMAIL_OVERRIDE_ADDRESS:
            receiver = settings.EMAIL_OVERRIDE_ADDRESS

        send_mail(subject, message, from_email, [receiver], **kwargs)
382235
def add_user(self, name: str, email: str) -> models.User:
        """"""
        new_user = self.User(name=name, email=email)
        self.add_commit(new_user)
        return new_user
1191404
def change_email(self, old_email, new_email):
        
        log.info("[+] Changing account email to '{}'".format(new_email))
        return self._send_xmpp_element(account.ChangeEmailRequest(self.password, old_email, new_email))
662348
def add_user(self, recipient_email):
        
        self.import_key(emailid=recipient_email)
        emailid_list = self.list_user_emails()
        self.y = self.decrypt()
        emailid_list.append(recipient_email)
        self.encrypt(emailid_list=emailid_list)
781524
def get_user_by_email(server_context, email):
    
    url = server_context.build_url(user_controller, 'getUsers.api')
    payload = dict(includeDeactivatedAccounts=True)
    result = server_context.make_request(url, payload)

    if result is None or result['users'] is None:
        raise ValueError("No Users in container" + email)

    for user in result['users']:
        if user['email'] == email:
            return user
    else:
        raise ValueError("User not found: " + email)
152025
def register_by_email(self, email, sender=None, request=None, **kwargs):
        
        try:
            user = self.user_model.objects.get(email=email)
        except self.user_model.DoesNotExist:
            user = self.user_model.objects.create(
                username=self.get_username(),
                email=email,
                password=self.user_model.objects.make_random_password(),
            )
            user.is_active = False
            user.save()
        self.send_activation(user, sender, **kwargs)
        return user
760871
def get_user_id_from_email(self, email):
        
        accts = self.get_all_user_accounts()

        for acct in accts:
            if acct['email'] == email:
                return acct['id']
        return None