I want rules to publish a status message when a certain node type has been published.

$message = "my message";
if (isset($message)) {
      drupal_set_message($message);
    }

doesnt seem to work, what might I be doing wrong?

Thanks!

Comments

nevets’s picture

If you are using rules why not simply use an action of type "Show a message on the site"?

TheOldGuy223’s picture

I thought about that but Im trying to embed it inside the php code for debugging purposes . To achieve exactly what you suggested in the other post.

nevets’s picture

Try adding a ""Show a message on the site" action to see if that shows.

You do not really need the isset() test, but if the message does not show, it is likely because the rule is not working as expected, your php code has a syntax error or you have the message inside an 'if' that is never true