/**
  * Create an email verification key and send a verification email.
  *
  * @param \Registration\Model\MemberModel $memberModel
  */
 private function createEmailVerificationEmail(MemberModel $memberModel)
 {
     $memberEmailVerificationsMapper = $this->getMemberEmailVerificationsMapper();
     $memberEmailVerificationModel = $memberEmailVerificationsMapper->createModelFromData();
     $memberEmailVerificationModel->email = $memberModel->email;
     $memberEmailVerificationModel->security_key = NovumWareHelpers::generateKey(32);
     $this->getMemberEmailVerificationsMapper()->insertModel($memberEmailVerificationModel);
     $this->sendEmailVerificationEmail($memberEmailVerificationModel);
 }
 /**
  * @param string $email
  * @return \NovumWare\Process\ProcessResult
  */
 protected function _createPasswordVerification($email)
 {
     $memberModel = $this->getMembersMapper()->fetchOneForEmail($email);
     if (!$memberModel) {
         throw new ProcessException('Could not find that email address');
     }
     $passwordResetModel = $this->getMemberPasswordResetsMapper()->createModelFromData();
     $passwordResetModel->email = $email;
     $passwordResetModel->security_key = NovumWareHelpers::generateKey(32);
     $this->getMemberPasswordResetsMapper()->insertModel($passwordResetModel);
     $resetLink = $this->urlCanonical('password/reset', array('email' => $passwordResetModel->email, 'securityKey' => $passwordResetModel->security_key));
     $this->getEmailsProcess()->sendEmailFromTemplate($email, EmailConstants::PASSWORD_RESET_SUBJECT, EmailConstants::PASSWORD_RESET_TEMPLATE, array('resetLink' => $resetLink));
 }