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']);
}