Skip to main content
3 of 3
added note to indicate a bug blocking a successful test.

Updated Answer

Whilst testing this on a fresh install of Drupal 8 with Rules (Alpha 2) I have come across a bug which is preventing a successful test of this, whilst the data selector below is correct I am presently unable to reproduce a working rule.

The bug report is here: https://www.drupal.org/node/2770291 - To summarise this issue Rules is expecting the TO: parameter to be an array and will throw an error when passing the email address token below which returns a string.

My initial answer holds true for Drupal 7 however for Drupal 8 the situation seems simpler and hinges on a single fact that isn't yet well-documented.

In D7 we're familiar with a syntax resembling: comment:node:author:mail

In D8 the same selector (which works) is: comment.entity_id.entity.uid.entity.mail.value

Hopes this helps, I'm leaving the previous answer below in case it helps someone else.

Previous Answer

*In general with Rules to use the value of a field the rule must first specifically check for the existence of the field (i.e. that the field has a value in the context the rule is running). If you haven't tried this already you might want to try adding an "Entity has field" condition to the rule to check for the existence of the email address. This should then expose the token for the field.

I've had similar issues executing rules using entity relations (which is more or less what you're doing by referencing the author from the node) checking for the existence of the field (in your case most likely a check that the entity has an author (this should open up access to the user object) then a check against the user object to ensure it has an email address) opened up the available field tokens from the referenced entity.*