Closed (fixed)
Project:
Rules
Version:
6.x-1.0
Component:
Rules Engine
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Jun 2009 at 18:17 UTC
Updated:
24 Nov 2011 at 17:35 UTC
If have a rule that sends a mail to an arbitrary email address. The mail was being sent successfully until I inserted the following code:
if ( $node->field_authorizer[0][value] == 'Mr. John Mason') {
echo 'jmason@lomira.k12.wi.us' ;
}
elseif ( $node->field_authorizer[0][value] == 'Mr. Bob Lloyd') {
print 'blloyd@lomira.k12.wi.us';
}
elseif ( $node->field_authorizer[0][value] == 'Mrs. Lori Loehr') {
print 'lloehr@lomira.k12.wi.us';
}
elseif ( $node->field_authorizer[0][value] == 'Mrs. Shannon Stein') {
print 'sstein@lomira.k12.wi.us';
}
else {
print 'That thing didn't work at all.';
}
Now it says: Unable to send e-mail. Please contact the site administrator if the problem persists.
I'm fairly certain that is the correct syntax. I even tried adding "global $user;" (shouldn't be necessary) but still no dice.
I'm guessing Rules simply doesn't support that sort of PHP? Or my PHP is wrong?
Comments
Comment #1
ballerjones commentedBy the way, I did fix that apostrophe error:
to:
But still get the same error.
Comment #2
fagoComment #3
ballerjones commentedRead my last sentence:
"But still get the same error."
Comment #4
mitchell commentedFor a related feature request, see #326808: Support logic-based dialects (if/then/else).
Comment #5
mitchell commentedClosing older issues to make the issue queue easier to navigate. If you still need assistance, please try the latest versions, read through the documentation handbooks, and search for other other issues with relevant responses. This will more than likely give you an answer to your question, or you can always open another issue. If you have any further help to offer people who may find this issue, please add it even though it is closed or add this info to the documentation handbook. Thank you.