I have a custom node. One of the fields it has is a user reference. I wish to send an email to that user of tha开发者_运维技巧t reference when the node is updated. I am trying to use the Rules module to do to this. I can get the uid but not the mail address from the tokens.
Is there any way I can execute some php from within the to field and the body. My php is being read as text.
I am using the send to arbitrary email address.
Use the user_load function to load up the user's object, then specify the mail address based on that.
// Change $node->field_userreference to point to the correct CCK field
$recipient = user_load($node->field_userreference);
return $recipient->mail;
精彩评论