def send_confirmation_email(self):
        """
        View function which sends confirmation token and instructions to a user.
        """
        form = self._get_form('SECURITY_SEND_CONFIRMATION_FORM')
        if form.validate_on_submit():
            self.security_service.send_email_confirmation_instructions(form.user)
            self.flash(_('flask_unchained.bundles.security:flash.confirmation_request',
                         email=form.user.email), category='info')
            if request.is_json:
                return '', HTTPStatus.NO_CONTENT

        elif form.errors and request.is_json:
            return self.errors(form.errors)

        return self.render('send_confirmation_email',
                           send_confirmation_form=form,
                           **self.security.run_ctx_processor('send_confirmation_email'))
def send_confirmation_email ( self ) : form = self . _get_form ( 'SECURITY_SEND_CONFIRMATION_FORM' ) if form . validate_on_submit ( ) : self . security_service . send_email_confirmation_instructions ( form . user ) self . flash ( _ ( 'flask_unchained.bundles.security:flash.confirmation_request' , email = form . user . email ) , category = 'info' ) if request . is_json : return '' , HTTPStatus . NO_CONTENT elif form . errors and request . is_json : return self . errors ( form . errors ) return self . render ( 'send_confirmation_email' , send_confirmation_form = form , ** self . security . run_ctx_processor ( 'send_confirmation_email' ) )
View function which sends confirmation token and instructions to a user.