コード例 #1
0
ファイル: FormEntityHandler.php プロジェクト: bolt/Members
 /**
  * Create account verification key profile meta.
  *
  * @param MembersProfileEvent $event
  * @param string              $guid
  */
 protected function createAccountVerificationKey(MembersProfileEvent $event, $guid)
 {
     $metaValue = sha1(Uuid::uuid4()->toString());
     // Set the email verification key in the account meta
     $meta = new Storage\Entity\AccountMeta();
     $meta->setGuid($guid);
     $meta->setMeta(AccountVerification::KEY_NAME);
     $meta->setValue($metaValue);
     $this->records->saveAccountMeta($meta);
     $event->addMetaEntryNames([AccountVerification::KEY_NAME => $metaValue]);
 }
コード例 #2
0
ファイル: ProfileListener.php プロジェクト: bolt/Members
 /**
  * Generate the HTML for the verification email.
  *
  * @param MembersProfileEvent $event
  *
  * @return string
  */
 private function getRegisterHtml(MembersProfileEvent $event)
 {
     $meta = $event->getMetaEntityNames();
     $query = http_build_query(['code' => $meta[AccountVerification::KEY_NAME]]);
     $context = ['name' => $event->getAccount()->getDisplayname(), 'email' => $event->getAccount()->getEmail(), 'link' => sprintf('%s/%s/profile/verify?%s', $this->siteUrl, $this->config->getUrlMembers(), $query), 'member' => $event->getAccount()];
     $mailHtml = $this->twig->render($this->config->getTemplate('verification', 'body'), $context);
     return $mailHtml;
 }