Score:0

Send mail with Data Selector

us flag

In Drupal 9 Rules 8.x alpha 7 - I have a rule working. However, I am trying to send an email to the user of the account that is changed.

I am trying to figure out the data selector to make this happen. I have tried token for an email: {{ profile.uid.entity.mail }} I have tried profile.uid.entity.mail.value as a data selector and many other things I am finding online.

I have Entity is of Bundle and Field is of type in the conditions to grab the field in the user account.

If I put in a specific email it works. Anyone figure out the data selector for this?

Score:0
us flag

Okay, it took a while but I got it to work. I am using the Profile module with the Drupal account. This rule is on Profile update.

In the Condition: you need 'Entity is of Type' - data_selector = profile, and value = profile Then you need 'Entity has field' with data_selection = @user.current_user_context:current_user and value as 'mail'

Than...You create an Action "send Mail' - in the Send to: direct input I used this {{ profile.uid.entity.mail }} Added a message and tested.

It works!!!

Hope that helps someone.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.