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

CommentFileSizeAuthor
#5 webform-3391402-mr362.patch1.41 KBsolideogloria

Issue fork webform-3391402

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

solideogloria created an issue. See original summary.

solideogloria’s picture

Issue summary: View changes

solideogloria’s picture

Status: Active » Needs review
solideogloria’s picture

StatusFileSize
new1.41 KB

Patch file for ease of use. Same as the MR.

jrockowitz’s picture

Version: 6.2.x-dev » 6.1.x-dev
Status: Needs review » Reviewed & tested by the community

Liam Morland made their first commit to this issue’s fork.

liam morland’s picture

Version: 6.1.x-dev » 6.2.x-dev
Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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