Rules send email containing tokens from submitted node displays token for empty field I have a rule that sends the contents of a node to an email address on save, I am including the contents of the mail with tokens. However, if the field is blank then instead of not showing, the token itself shows in the email. Is there any way to prevent this from happening, or include all the fields in one token?
you may use PhP in your send mail rule action to check if your field is empty.

Be careful it's a bit tricky because token is not actually empty when the field is empty, it's just not computed, as you saw when you tested.

Unfortunately, the token will be rendered, if field not empty, whatever you put around it in PhP, even ' or ".

So, it's not really clean, but the way I see it is explode and then check whatever you want (for my part I use here only the first part, "[node") :

&lt;?php
// Explode your token (or your value, you don't know yet)
$a = explode(':',"[node:body]");

// Check if first part is [node
if($a[0] != '[node') { ?&gt; 

[node:body]

//Don't forget to close the if() statement
&lt;? } ?&gt;


Not very good if you have to check this on many fields, NOT CLEAN at all in fact, but working :D