I made a rule that sends emails to an arbitrary address. However, the emails being sent show unevaluated php. The email sent reads:

Subject: Authorization Reqeust <? $author ?>'s Teacher Absence Form
Content: Please authorize this form:<? $node?>

What could be the problem? Why isn't the rule sending the php already evaluated?

Comments

mitchell’s picture

Component: Rules Core » Rules Engine

This definitely seems like a bug to me.

@ballerjones: In the meantime, you could use token.

ballerjones’s picture

I fixed the problem. Just had to make <? into <?php

However, $node and $author aren't being parsed. Just blank spaces in the email. Any ideas?

fago’s picture

Category: bug » support
Status: Active » Fixed

$node is an object, try e.g. $node->title

ballerjones’s picture

ok, so i figured a lot of things out, but for some reason this won't parse:

print $node->content['group_nd']['field_tname']['#value'];

however, this did:

print $node->nid;

Why?

I even tested trying to print a field value that isn't inside a group:

print $node->content['field_test']['#value'];

but no dice

fago’s picture

I suppose those values are not available when the php code is executed, try invoking node_build_content() on the node before.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.