Cannot use account.mail.value as Send To data selector for action SystemSendEmail

Created on 13 September 2016, about 8 years ago
Updated 2 September 2024, 3 months ago

Want to send email to a user account. Have the user account object, it of course has the account.mail.value which is the account email address.

However, the Rules interface complains that it's expecting a List data type and was given an Email data type when I try to assign account.mail.value as the Send To via a data selector. This is for the System Send Email action.

What is the proper way to send email to a user account?

The exact error message in the interface is:

Expected a list data type for context Send to but got a email data type instead.

The second is: why is message a text field??

🐛 Bug report
Status

Closed: duplicate

Version

3.0

Component

Rules Core

Created by

🇺🇸United States john.oltman

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India shradha.gupta87

    Hi,

    I can confirmed the fix in #6 worked for me as a workaround. You need to switch to direct input mode and add you mail value in
    {{node.field_mail.value}} in this format. And you are done. :)

    Thanks.

  • 🇺🇸United States iseeaflyingcrane

    Hello, I tried the direct input mode and put the token in double parenthesis. But I still get the same error as below. I am using rules 4.0.0 and typed_data 2.1.0. Any idea how to fix this?

    TypeError: Drupal\typed_data\PlaceholderResolver::scan(): Argument #1 ($text) must be of type string, null given, called in /rules/src/Plugin/RulesDataProcessor/TokenProcessor.php on line 69 in Drupal\typed_data\PlaceholderResolver->scan() (line 178 of modules/contrib/typed_data/src/PlaceholderResolver.php).

    Also when I use the direct input mode, and put an actual email address xxx@gmail.com I still got the same error. Help please!

Production build 0.71.5 2024