I have two content types:
* business partner (B)
* service (S)
The relationship is as follows: S --> B
It means in service content type, I have a field named business_partner_ref with Entity Reference type. In business partner content type, I have a field named account_manager-ref with Entity Reference type which refers to drupal User
entity.
I want an email has been sent to account manager of a business partner when a change occurs in workflow state of service content type. So in action part of rules module I add a send mail action and in from part of it, I use the token [node:business_partner_ref:account_manager-ref:mail]. But it leave empty string in TO field of email action. When I user [node:business_partner_ref:account_manager-ref] it prints the username of account manager!

Is it a bug or my mistake?

Comments

spotzero’s picture

Issue summary: View changes
Priority: Critical » Normal
Status: Active » Closed (cannot reproduce)

I rebuilt your described setup and it seems to work correctly, however this won't work with tokens.

You need to use the data selector with node:business-partner-ref:0:account_manager-ref:mail and you also need a rules condition that checks the bundle of node:business-partner-ref:0 to make sure it's a business partner, or else the data selector won't resolve.