PHP evaluation for "Send HTML email body" I'm trying to compose the body of an email using PHP evaluation within a rule.  The rule is triggered when a new content is saved.  Part of the email body is composed using HEREDOC and that works fine.  This is the code I'm having trouble with:

//  Provide download link.
 if ($node-&gt;field_software_product_sku === "Some Product Name")
     echo "&lt;a href=\"http://www.mywebsite.com/Some Product Name/some.exe\"&gt;Trial Version Download Link&lt;/a&gt;&lt;br /&gt;";


The above code comes directly after the ending of the HEREDOC, but, before the closing '?>'.  I anticipate that in the future, I will need to add more clauses to the 'if' statement, so, it's important that I get this to work.

I've tried several different incantations for coding the 'if'.  I've tried using the token name enclosed in single quotes.  And, I've tried using “==” instead of “===”.  The only thing that seems to work consistently is commenting out the 'if'.  Then, the “Trial Download Link” text does appear in the email.  Unfortunately, the rule is to be used for multiple “skus”, so, I need to use the 'if'.

I'm hoping I've made a subtle mistake, or, overlooked something.  

Can someone point me in the right direction?  

Is there a way to debug the code to see why the 'if' may be failing?
If field_software_product_sku is text field you should test on value of the field something like:

if ($node-&gt;field_software_product_sku[LANGUAGE_NONE][0]['value'] === "Some Product Name"){
    echo "&lt;a href=\"http://www.mywebsite.com/Some Product Name/some.exe\"&gt;Trial Version Download Link&lt;/a&gt;&lt;br /&gt;";
  }


other ways if it doesn't work, i suggest you to use Devel Module and dump the $node-&gt;field_software_product_sku using dpm function to see the value of the field:
dpm($node-&gt;field_software_product_sku) and then check on the value of the field.