Using Invisimail within a Contemplate Template I'm in Drupal 7 and using Contemplate and Invisimail, but I can't figure out how to get my emails to be obfuscated.

I think it is because the display of the node is using the contemplate template, which simply says:

&lt;?php print $node-&gt;field_email['und'][0]['email'] ?&gt;&lt;br/&gt;


I figure I have to wrap that in a call to invisimail_encode_email, as such:

&lt;?php print invisimail_encode_email($node-&gt;field_email['und'][0]['email'], 'html_entities') ?&gt;&lt;br/&gt;


but that did not work (error message about undefined array index). So, maybe I'm calling that function with the wrong parameters? or maybe I'm calling the wrong function.

Basically, how do I call invisimal from within php?
I'm doing a similar thing, but in a node template. To get the javascript obscured code to return, use the js_entities encoder similar to this:

&lt;?php
$email = render($content['field_email_address']);

// this takes the email address and turns it into a "mailto:" link, otherwise use 'link' =&gt; 0
$email_settings = array('link' =&gt; 1);

echo "&lt;p&gt;" . invisimail_encoder_js_entities_encode($email, $email_settings) . "&lt;/p&gt;";
?&gt;


Also, I use the Quick Javascript Switcher extension in Chrome to quickly toggle js off/on to see if things like this are working:

https://chrome.google.com/webstore/detail/quick-javascript-switcher/geddoclleiomckbhadiaipdggiiccfje