开发者

Drupal Rules sending an email address to a user reference

开发者 https://www.devze.com 2023-01-31 11:41 出处:网络
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

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;
0

精彩评论

暂无评论...
验证码 换一张
取 消