Tokens that aren't text don't work and break email processing

Created on 4 March 2024, 4 months ago

I'm trying to use an entity reference to a Domain entity, then utilize 2 separate tokens from here, one for the site name and the other for the domain name, but I'm getting errors which I believe are because the token doesn't return text as it should, but instead returns an object.

I tried
[easy_email:field_domain:entity:hostname]
[easy_email:field_domain:entity:hostname:name]
[easy_email:field_domain:entity:hostname:name:value]
ResponseText: The website encountered an unexpected error. Try again later.Error: Object of class Drupal\domain\Entity\Domain could not be converted to string in Drupal\Component\Render\HtmlEscapedText->__construct() (line 31 of core/lib/Drupal/Component/Render/HtmlEscapedText.php). Drupal\Core\Utility\Token->doReplace(1, 'Hello from [easy_email:field_domain:entity:hostname:name:value]', Array, Array, Object) (Line: 191)
Drupal\Core\Utility\Token->replace('Hello from [easy_email:field_domain:entity:hostname:name:value]',

Is there a way to avoid this issue by specifying the token in a different way or perhaps easy_email can handle htmlmarkup objects returned by tokens by converting them into text?

Thanks for a very useful module.

✨ Feature request
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States davemaxg

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024