How to send email using Rules from user references CCK Field? I have 2 types of content that are: Videos and Customers.

A video can be related only by 1 customer. I want that when a video is created or edited, will send an email to the customer associated with the video.

"Videos" has a Node_reference that is the customer reference. "Customers" have a user_reference referencing the corresponding user.

Then, using Rules for send mail but I don't know how to get the email of the user from the field node_reference from "Videos" to user_reference of "Customers".

How can I do this?
In the recipient input, try to write a php code which returns the email :

$customer_node = node_load( $node-&gt;field_customer['und'][0]['nid'] );
$account = user_load( $customer_node-&gt;field_user['und'][0]['uid'] );
print $account-&gt;mail;


Note that a better way is to use a custom function in a custom module :

print _get_customer_email( $node );


and

function _get_customer_email( $node ){
  $customer_node = node_load( $node-&gt;field_customer['und'][0]['nid'] );
  $account = user_load( $customer_node-&gt;field_user['und'][0]['uid'] );
  return $account-&gt;mail;
}