When defining an email handler email address, webform uses the #allow_tokens option. In this case, it skips the regular email validator if the value starts and ends with a token /^\[.*\]$/. There are many valid email address that can be made up from tokens that don't match this pattern, such as [member-name]@[domain] or [member-name]@domain.com or even "[name]" <[mail]>.

I suggest we relax the pattern to just test to see if a token is present, not that it is the whole string.

Comments

DanChadwick created an issue. See original summary.

danchadwick’s picture

Status: Active » Needs review
StatusFileSize
new783 bytes
jrockowitz’s picture

The patch looks fine. We should also update the related test.

@see \Drupal\Tests\webform\Functional\Element\WebformElementEmailMultipleTest

danchadwick’s picture

With a bit more test coverage.

jrockowitz’s picture

Status: Needs review » Fixed

Thanks for the patch.

  • DanChadwick authored d0fd9d7 on 8.x-5.x
    Issue #3093873 by DanChadwick: WebformEmailMultiple validation too...

Status: Fixed » Closed (fixed)

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