You are here

function hook_email_confirmer in Email confirmer 8

Acts on email confirmation responses.

This hook allows a module to get notified when a confirmation response is received.

Parameters

string $op: Either "confirm" or "cancel".

\Drupal\email_confirmer\EmailConfirmationInterface $confirmation: The confirmation process.

1 function implements hook_email_confirmer()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

email_confirmer_user_email_confirmer in email_confirmer_user/email_confirmer_user.module
Implements hook_email_confirmer().
2 invocations of hook_email_confirmer()
EmailConfirmation::cancel in src/Entity/EmailConfirmation.php
Cancel the email confirmation.
EmailConfirmation::confirm in src/Entity/EmailConfirmation.php
Process the email confirmation.

File

./email_confirmer.api.php, line 21
Document api for email confirmer module.

Code

function hook_email_confirmer($op, EmailConfirmationInterface $confirmation) {

  // Log the event.
  \Drupal::logger('email_confirmer')
    ->info('Email confirmation @cid ' . ($op == 'confirm' ? 'confirmed' : 'cancelled'), [
    '@cid' => $confirmation
      ->id() ?: '-not saved-',
  ]);
}