I have a "child" content type that uses a node reference to another "parent" content type. The child displays the parent's field values through a node reference field. I want to use a rules link to initiate some actions, one of which is to send an email to the address held in one of the parent's fields. The tokens seem to display in the replacement patterns for "Send HTML email" in the rules UI. But the value is empty, I am sure because the fields from the parent entity are displayed as "rendered" and are no longer fields. I have tried so many different ways to extract this email to no avail.

Most recently, I tried a field reference field to carry the parent's email to the child. This seems to work, but it is not automatically populated. The node reference system allows the "reference from URL" to automatically populate the field with the parent node. But there's nothing like that for field reference, to use the nid being passed to extract the email from the parent node in question. I get a select box to choose the parent node, then it does save the email in the field. I need this last part to just happen without the user having to select.

Any ideas?

Comments

nicoz’s picture

You need to add an action before your email to fetch Entity by property. Then in your email action drill down to that fetched entity.

jo1ene’s picture

https://www.drupal.org/node/2796371

I'm thinking that's related to the answer here.