Update the user's email address using data from provider.
776173
def update_email(strategy, details, user=None, *args, **kwargs):
    """"""
    if user:
        email = details.get('email')

        if email and user.email != email:
            user.email = email
            strategy.storage.user.changed(user)
16944
function doUpdateEmail(Userinfo $userinfo, Userinfo &$existinguser, $overwrite)
	{
		$changed = false;

		if (strtolower($existinguser->email) != strtolower($userinfo->email)) {
			$this->debugger->addDebug(Text::_('EMAIL_CONFLICT'));
			$update_email = $this->params->get('update_email', false);
			if ($update_email || $overwrite) {
				$this->debugger->addDebug(Text::_('EMAIL_CONFLICT_OVERWITE_ENABLED'));
				try {
					$this->updateEmail($userinfo, $existinguser);
					$changed = true;
				} catch (Exception $e) {
					$this->debugger->addError(Text::_('EMAIL_UPDATE_ERROR') . ' ' . $e->getMessage());
				}
			} else {
				//return a email conflict
				$this->debugger->addDebug(Text::_('EMAIL_CONFLICT_OVERWITE_DISABLED'));

				$this->debugger->set('userinfo', $existinguser);
				throw new RuntimeException(Text::_('EMAIL') . ' ' . Text::_('CONFLICT') . ': ' . $existinguser->email . ' -> ' . $userinfo->email);
			}
		}
		return $changed;
	}
309467
function update(req, res, next) {
  var options = req.connectionOptions;
  req.appformsResultPayload = req.appformsResultPayload || {};

  var params = {
    userEmail: req.user.email
  };

  options = _.extend(options, params);

  var form = req.body;

  if (_.isObject(req.appformsResultPayload.data) && !req.body._id) {
    form = req.appformsResultPayload.data;
  }

  logger.debug("Middleware: Update form: ", {options: options, form: form});

  forms.updateForm(options, form, formsResultHandlers(constants.resultTypes.forms, req, next));
}
837875
def add_email_address(self, email, hidden=None):
        
        existing_emails = get_value(self.obj, 'email_addresses', [])
        found_email = next(
            (existing_email for existing_email in existing_emails if existing_email.get('value') == email),
            None
        )
        if found_email is None:
            new_email = {'value': email}
            if hidden is not None:
                new_email['hidden'] = hidden
            self._append_to('email_addresses', new_email)
        elif hidden is not None:
            found_email['hidden'] = hidden
786684
def send_email(self, user, subject, msg):
        """"""
        print('To:', user)
        print('Subject:', subject)
        print(msg)
1225633
def update_user(self, instance, user, name=None, password=None, host=None):
        
        return instance.update_user(user, name=name, password=password,
                host=host)
1190447
public function ChangeSelectedAddress()
    {
        $this->SetPreventProcessStepMethodFromExecuting(true);
        // the method only works if the user is logged in
        $oUser = self::getExtranetUserProvider()->getActiveUser();
        if ($oUser->IsLoggedIn()) {
            $sNewShippingAddressId = $this->GetShippingAddressData('selectedAddressId');
            $sNewBillingAddressId = $this->GetBillingAddressData('selectedAddressId');

            if ('1' == $this->GetShipToBillingAddress()) {
                if (0 != strcmp($sNewBillingAddressId, $sNewShippingAddressId)) {
                    if (TdbDataExtranetUserAddress::FORM_DATA_NAME_BILLING == $this->AddressUsedAsPrimaryAddress()) {
                        $sNewShippingAddressId = $sNewBillingAddressId;
                    } else {
                        $sNewBillingAddressId = $sNewShippingAddressId;
                    }
                }
            } else {
                // they were different.. if they are now the same, we should set the new state
                if (0 == strcmp($sNewBillingAddressId, $sNewShippingAddressId)) {
                    $this->SetShipToBillingAddress('1');
                }
            }

            if (!empty($sNewBillingAddressId)) {
                if ('new' != $sNewBillingAddressId) {
                    $oNewBillingAdr = $oUser->SetAddressAsBillingAddress($sNewBillingAddressId);
                    if ($oNewBillingAdr) {
                        $this->SetBillingAddressData($oNewBillingAdr->sqlData);
                    } else {
                        // invalid request...
                        if (false == $this->GetBillingAddressData('selectedAddressId')) {
                            // there was nothing selected... so we get an an alternative
                            $sNewBillingAddressId = $this->GetAnotherAddressFromUser($sNewBillingAddressId, TdbDataExtranetUserAddress::FORM_DATA_NAME_BILLING);
                            $oNewBillingAdr = $oUser->SetAddressAsBillingAddress($sNewBillingAddressId);
                            if ($oNewBillingAdr) {
                                $this->SetBillingAddressData($oNewBillingAdr->sqlData);
                            } else {
                                $this->SetBillingAddressData(array('selectedAddressId' => 'new'));
                            }
                        }
                    }
                } else {
                    $this->SetBillingAddressData(array('selectedAddressId' => 'new'));
                }
            }

            if (!empty($sNewShippingAddressId)) {
                if ('new' != $sNewShippingAddressId) {
                    $oNewShippingAdr = $oUser->SetAddressAsShippingAddress($sNewShippingAddressId);
                    if ($oNewShippingAdr) {
                        $this->SetShippingAddressData($oNewShippingAdr->sqlData);
                    } else {
                        // invalid request...
                        if (false == $this->GetShippingAddressData('selectedAddressId')) {
                            // there was nothing selected... so we get an an alternative
                            $sNewShippingAddressId = $this->GetAnotherAddressFromUser($sNewBillingAddressId, TdbDataExtranetUserAddress::FORM_DATA_NAME_SHIPPING);
                            $oNewShippingAdr = $oUser->SetAddressAsShippingAddress($sNewShippingAddressId);
                            if ($oNewShippingAdr) {
                                $this->SetShippingAddressData($oNewShippingAdr->sqlData);
                            } else {
                                $this->SetShippingAddressData(array('selectedAddressId' => 'new'));
                            }
                        }
                    }
                } else {
                    $this->SetShippingAddressData(array('selectedAddressId' => 'new'));
                }
            }

            // check if shipping != billing AND ShipToBillingAddress() == '1' or the other way around. if that is the case,
            // then we need to adjust ShipToBillingAddress to match the new setting
            if (1 == $this->GetShipToBillingAddress() && $this->GetShippingAddressData('selectedAddressId') != $this->GetBillingAddressData('selectedAddressId')) {
                $this->SetShipToBillingAddress(0);
            } elseif (0 == $this->GetShipToBillingAddress() && $this->GetShippingAddressData('selectedAddressId') == $this->GetBillingAddressData('selectedAddressId')) {
                $this->SetShipToBillingAddress(1);
            }
            TShopBasket::GetInstance()->RecalculateBasket();
        }
    }
1254322
public function update($username, $firstName, $lastName, $newUsername, $emailAddress, $active = true)
    {
        $parameters = array(
            'first-name' => $firstName,
            'last-name' => $lastName,
            'display-name' => $newUsername,
            'email' => $emailAddress,
            'active' => $active
        );
        return $this->apiClient->callEndpoint(
            sprintf('user?username=%s', $username),
            $parameters,
            null,
            HttpMethod::REQUEST_PUT
        );
    }
1309546
def resend_email_changed_message(self, user, base_url):
        
        user.require_email_confirmation()
        self.save(user)
        self.send_email_changed_message(user, base_url)
468494
def save_user_and_user_email(self, user, user_email):
        """"""
        if self.UserEmailClass:
            self.db_adapter.save_object(user_email)
        self.db_adapter.save_object(user)
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])
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})
691553
void updateUserInfo() {

        try {
            m_user = m_context.getCms().readUser(m_user.getId());
            displayResourceInfoDirectly(Collections.singletonList(CmsAccountsApp.getPrincipalInfo(m_user)));
        } catch (CmsException e) {
            LOG.error("Error updating user info.", e);
        }
    }
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
705240
def user_update(self, display_name=None, first_name=None, last_name=None,
                    email=None, password=None, current_password=None,
                    birth_date=None, gender=None, website=None, subdomain=None,
                    location=None, newsletter=None, primary_usage=None,
                    timezone=None):
        
        return self.request("user/update", QueryParams({
            "display_name": display_name,
            "first_name": first_name,
            "last_name": last_name,
            "email": email,
            "password": password,
            "current_password": current_password,
            "birth_date": birth_date,
            "gender": gender,
            "website": website,
            "subdomain": subdomain,
            "location": location,
            "newsletter": newsletter,
            "primary_usage": primary_usage,
            "timezone": timezone
        }))
456450
public function updateUserWithAmazonData()
    {
        $billingAddress = $this->getAmazonBillingAddress();

        if ($billingAddress !== null) {
            $oUser = $this->getUser();
            $oUser->assign($billingAddress);
            $oUser->save();
        }
    }
658629
def update_domain(self, domain, emailAddress=None, ttl=None, comment=None):
        
        return domain.update(emailAddress=emailAddress,
                ttl=ttl, comment=comment)