Problem/Motivation
When selecting Webform submission author display name as the From address for an email handler, the token doesn't get replaced. The same goes for the Webform submission author account name option.
Steps to reproduce
At EmailWebformHandler.php:401
$other_element_name_options = [
'[site:name]' => 'Site name',
'[current-user:display-name]' => 'Current user display name',
'[current-user:account-name]' => 'Current user account name',
'[webform:author:display-name]' => 'Webform author display name',
'[webform:author:account-name]' => 'Webform author account name',
'[webform_submission:account:display-name]' => 'Webform submission author display name',
'[webform_submission:account:account-name]' => 'Webform submission author account name',
];
However, [webform_submission:account:?] is not a valid token.
Proposed resolution
It should be "user" instead of "account" for those two tokens:
$other_element_name_options = [
'[site:name]' => 'Site name',
'[current-user:display-name]' => 'Current user display name',
'[current-user:account-name]' => 'Current user account name',
'[webform:author:display-name]' => 'Webform author display name',
'[webform:author:account-name]' => 'Webform author account name',
'[webform_submission:user:display-name]' => 'Webform submission author display name',
'[webform_submission:user:account-name]' => 'Webform submission author account name',
];
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
solideogloria commentedComment #4
solideogloria commentedComment #5
solideogloria commentedPatch file for ease of use. Same as the MR.
Comment #6
jrockowitz commentedComment #9
liam morland