You are here

public function UserEmailVerification::buildVerificationUrl in User email verification 8

Build Email verification URL for requested user.

Parameters

\Drupal\user\UserInterface $user: User to create email verification URL for.

Return value

\Drupal\Core\Url Email verification URL.

Overrides UserEmailVerificationInterface::buildVerificationUrl

File

src/UserEmailVerification.php, line 223

Class

UserEmailVerification
User email verification helper service.

Namespace

Drupal\user_email_verification

Code

public function buildVerificationUrl(UserInterface $user) {
  $timestamp = $this->time
    ->getRequestTime();
  $hashed_pass = $this
    ->buildHmac($user
    ->id(), $timestamp);
  return Url::fromRoute('user_email_verification.verify', [
    'uid' => $user
      ->id(),
    'timestamp' => $timestamp,
    'hashed_pass' => $hashed_pass,
  ], [
    'absolute' => TRUE,
  ]);
}