Get, validate, and confirm user's email address
547656
def get_sender_gmail
      puts "Enter your gmail address:"
      while @from_address = gets.chomp
        catch :badfrom do
          if ValidateEmail.validate(@from_address) == true
            puts "Is your email address #{@from_address}? [y/n]:"
            while address_confirmation = gets.chomp
              case address_confirmation
              when 'y'
                return
              else
                puts "Please re-enter your gmail address:"
                throw :badfrom
              end
            end
          else
            puts "Email invalid! Please enter a valid email address:"
          end
        end
      end
    end
100757
def create_emailconfirmation(self, email_address):
        ""
        confirmation_key = self.generate_key(email_address.email)
        confirmation = self.create(
            email_address=email_address,
            created_at=now(),
            key=confirmation_key,
        )
        return confirmation
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
807152
private function verify_email() {
            $this->_handle_account_user_sync();

            if ( $this->_user->is_verified() ) {
                return;
            }

            $api    = $this->get_api_site_scope();
            $result = $api->call( "/users/{$this->_user->id}/verify.json", 'put', array(
                'after_email_confirm_url' => $this->_get_admin_page_url(
                    'account',
                    array( 'fs_action' => 'sync_user' )
                )
            ) );

            if ( ! isset( $result->error ) ) {
                $this->_admin_notices->add( sprintf(
                    $this->get_text_inline( 'Verification mail was just sent to %s. If you can\'t find it after 5 min, please check your spam box.', 'verification-email-sent-message' ),
                    sprintf( '<a href="mailto:%1s">%2s</a>', esc_url( $this->_user->email ), $this->_user->email )
                ) );
            } else {
                // handle different error cases.

            }
        }
542911
def is_email_verified(self, request, email):
        
        ret = False
        verified_email = request.session.get('account_verified_email')
        if verified_email:
            ret = verified_email.lower() == email.lower()
        return ret
210558
def is_valid_email(self):
        
        return bool(self.address and Email.re_email.match(self.address))
168991
def generate_confirmation_token(user):
    
    data = [str(user.id), hash_data(user.email)]
    return _security.confirm_serializer.dumps(data)
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();
  }
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
868911
def send_verification(self, attribute='email'):
        
        self.check_token()
        self.client.get_user_attribute_verification_code(
            AccessToken=self.access_token,
            AttributeName=attribute
        )
1066793
def GetUserByEmail(self, email):
    
    user = self.rpc_helper.GetAccountInfoByEmail(email)
    return GitkitUser.FromApiResponse(user)
678451
def getEmailAddresses(self):
        
        return self.store.query(
            EmailAddress,
            EmailAddress.person == self).getColumn('address')
1335395
def CheckEmail(self, email, checkTypo=False):
        ''''''
        contents = email.split('@')
        if len(contents) == 2:
            if contents[1] in self.valid:
                return True
        return False
900814
def send_registered_email(self, user, user_email, request_email_confirmation):
        """"""

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

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

        # Add a request to confirm email if needed
        if request_email_confirmation:
            # Generate a confirm_email_link
            token = self.user_manager.generate_token(user_email.id if user_email else user.id)
            confirm_email_link = url_for('user.confirm_email', token=token, _external=True)
        else:
            confirm_email_link = None

        # Render email from templates and send it via the configured EmailAdapter
        self._render_and_send_email(
            email,
            user,
            self.user_manager.USER_REGISTERED_EMAIL_TEMPLATE,
            confirm_email_link=confirm_email_link,
        )
69622
def post(self, request, key):
        """"""

        email = request.POST.get('email')
        user_id = request.POST.get('user')
        if not email:
            return http.HttpResponseBadRequest()

        try:
            EmailAddressValidation.objects.create(address=email,
                                                  user_id=user_id)
        except IntegrityError:
            # 409 Conflict
            #   duplicated entries
            #   email exist and it's waiting for validation
            return http.HttpResponse(status=409)

        return http.HttpResponse(status=201)
208756
def get_member_info_by_email(self, *args, **kwargs):
        
        return bind_api(
            api=self,
            path='/members/email/{email}',
            payload_type='author',
            allowed_param=['email']
        )(*args, **kwargs)
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,
        )