CakeDC\Users\Controller\SocialAccountsController::resendValidation PHP Method

resendValidation() public method

Resends validation email if required
public resendValidation ( string $provider, string $reference ) : Response | void
$provider string provider
$reference string reference
return Cake\Network\Response | void
    public function resendValidation($provider, $reference)
    {
        try {
            $result = $this->SocialAccounts->resendValidation($provider, $reference);
            if ($result) {
                $this->Flash->success(__d('CakeDC/Users', 'Email sent successfully'));
            } else {
                $this->Flash->error(__d('CakeDC/Users', 'Email could not be sent'));
            }
        } catch (RecordNotFoundException $exception) {
            $this->Flash->error(__d('CakeDC/Users', 'Invalid account'));
        } catch (AccountAlreadyActiveException $exception) {
            $this->Flash->error(__d('CakeDC/Users', 'Social Account already active'));
        } catch (Exception $exception) {
            $this->Flash->error(__d('CakeDC/Users', 'Email could not be resent'));
        }
        return $this->redirect(['plugin' => 'CakeDC/Users', 'controller' => 'Users', 'action' => 'login']);
    }