You are here

function hook_forward_token in Forward 4.x

Same name and namespace in other branches
  1. 8.2 forward.api.php \hook_forward_token()
  2. 4.0.x forward.api.php \hook_forward_token()

Add tokens before replacements are made within a Forward email.

A module implementing this hook must also have token processing defined in its my_module.tokens.inc file, otherwise the tokens added in this hook will never be replaced.

Parameters

\Drupal\Core\Form\FormStateInterface $form_state: A form_state being processed. This parameter may be null.

Return value

array A token array.

See also

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Utility%2...

1 invocation of hook_forward_token()
ForwardForm::getToken in src/Form/ForwardForm.php
Get a token.

File

./forward.api.php, line 32
Hooks provided by the Forward module.

Code

function hook_forward_token(FormStateInterface $form_state) {
  return [
    'my_module' => [
      'my_token' => 'my_value',
    ],
  ];
}