You are here

function simplenews_generate_hash in Simplenews 8

Same name and namespace in other branches
  1. 8.2 simplenews.module \simplenews_generate_hash()
  2. 7.2 simplenews.module \simplenews_generate_hash()
  3. 7 simplenews.module \simplenews_generate_hash()
  4. 3.x simplenews.module \simplenews_generate_hash()

Generates the hash key used for subscribe/unsubscribe link.

7 calls to simplenews_generate_hash()
ConfirmationController::confirmCombined in src/Controller/ConfirmationController.php
Menu callback: confirm a combined confirmation request.
ConfirmationController::confirmSubscription in src/Controller/ConfirmationController.php
Menu callback: confirm the user's (un)subscription request
SimplenewsSourceTest::testSendCaching in src/Tests/SimplenewsSourceTest.php
Test sending a newsletter to 100 recipients with caching enabled.
SimplenewsSubscribeTest::testSubscribeAnonymous in src/Tests/SimplenewsSubscribeTest.php
testSubscribeAnonymous
SimplenewsSubscribeTest::testSubscribeMultiple in src/Tests/SimplenewsSubscribeTest.php
Subscribe to multiple newsletters at the same time.

... See full list

File

./simplenews.module, line 875
Simplenews node handling, sent email, newsletter block and general hooks

Code

function simplenews_generate_hash($mail, $action = '', $timestamp = REQUEST_TIME) {
  $data = $mail . \Drupal::service('private_key')
    ->get() . $action . $timestamp;
  return Crypt::hashBase64($data);
}