You are here

function simplenews_generate_hash in Simplenews 3.x

Same name and namespace in other branches
  1. 8.2 simplenews.module \simplenews_generate_hash()
  2. 8 simplenews.module \simplenews_generate_hash()
  3. 7.2 simplenews.module \simplenews_generate_hash()
  4. 7 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 tests/src/Functional/SimplenewsSourceTest.php
Test sending a newsletter to 100 recipients with caching enabled.
SimplenewsSubscribeTest::testSubscribeAnonymous in tests/src/Functional/SimplenewsSubscribeTest.php
TestSubscribeAnonymous.
SimplenewsSubscribeTest::testSubscribeMultiple in tests/src/Functional/SimplenewsSubscribeTest.php
Subscribe to multiple newsletters at the same time.

... See full list

File

./simplenews.module, line 725
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);
}