It is quite common the need to add more fields to the forward form and to be able to use the fields as tokens for replacement.
Using hook_form_alter we can add the fields but there is no way we can add the new fields to be used as tokens for replacement. We can use hook_token_info and hook_tokens to expose them to the token module but the function `forward_recipient_list` the is building the content is never going to use it. One option would be to use the values directly from `$form_state['values']` or to allow modules through hook to return them.

CommentFileSizeAuthor
#1 forward-replacement-tokens-2492591-1.patch456 bytesvflirt

Comments

vflirt’s picture

StatusFileSize
new456 bytes

Adding patch.

john.oltman’s picture

Version: 7.x-2.x-dev » 8.x-1.x-dev
Status: Active » Fixed

  • john.oltman committed 81ad1d0 on 8.x-1.x
    Issue #2492591 by vflirt: Ability to add tokens for replacement
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ibuildit’s picture

[site:name] becomes "Drupal" in the email, both as sender and token replacements in the message as well as the twig template, regardless if the site configuration is different.

Not sure if this is core or forward.