Send mails based on cck fields

Events happening in the community are now at Drupal community events on www.drupal.org.
GolDRoger's picture

Hi guys, I'm trying to accomplish a rule wich works with facebook style statuses.

The rule start when occur the event user saves a status.

Under actions i have putted:

Load user account

And inside user name used the token: [status:recipient-name-raw]

Load content profile

User whose profile should be loaded: loaded user
Content type: user profile

And last one send a mail to a user.

And works perfectly :)

But Now i will do another thing. I have added to the user profile(is a node)
A cck field called status_stream_mail (text type, select list) with 2 values, Yes and No.

Now under condition i will evaluate this field and if turned on Yes user recieve a mail.

Unlucky under condition i can't slect nothing regarding cck. So i can only exegute custom php code, check a truth value or compare two texts.

But i dont know how to do this :/ someone can help please?

Comments

Forgot to mention i had

GolDRoger's picture

Forgot to mention i had opened a post here
http://drupal.org/node/1212990

Forgot to mention i had

GolDRoger's picture

Forgot to mention i had opened a post here
http://drupal.org/node/1212990

I found a solution but i

GolDRoger's picture

I found a solution but i cannot understand why doesn't work.

But if u put this code in a block and i go on a user profile with field_status_mail it tells me true or false.

Can't understand why in rules will not work

I have created a custom php code inserted in Exegute custom PHP

<?php

if ($user || (arg(0) == 'user' && arg(2) != 'edit')) {
  
$system_path = arg(1);

  
$viewed_user $system_path;
}

$profile_node = content_profile_load('uprofile', $viewed_user );


$cck_value = $profile_node->field_status_mail[0]['value'];

if(
$cck_value == 'yes'){
return
TRUE;

} else{
return
FALSE;
}

?>

Someone can help me please?

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: