Problem/Motivation

Webform Twig-Extensions uses a too generic regular expression for token replacement.

Steps to reproduce

Configure a Webform Email Handler which uses a Twig Template with Custom tokens to send an email with included webform inputs. like described in the Screenshot.

Proposed resolution

Improve the used Regex.

Remaining tasks

Improve the used Regex.

User interface changes

no

API changes

no

Data model changes

no

CommentFileSizeAuthor
webform_token_replacement.png3.66 MBzuernbernhard

Comments

zuernBernhard created an issue. See original summary.

zuernbernhard’s picture

See line 284 and following in the screenshot for understanding.

zuernbernhard’s picture

Quick and dirty workaround: Use Twig Tokens for Custom Twig Body:

{{ webform_token('[webform_submission:values:vorname]', webform_submission) }} {{ webform_token('[webform_submission:values:name]', webform_submission) }},

jrockowitz’s picture

Status: Active » Postponed (maintainer needs more info)

@zuernBernhard Can you please provide an example webform that can be used to replicate this issue?

BTW, using the webform_token() Twig function is the better approach.

jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)