Hi,

It would be useful for me (and maybe others) to have optional PHP evaluation in webform email templates. I'd like to create a URL with a hash of an email value tagged on the end, for instance (I do not want to use sessions to store such data).

This is what I inserted at line 186 in webform.submissions.inc:

    // PHP in the template?
    if(strpos($email['message'], '<?php') !== FALSE){
    	$email['message'] = drupal_eval($email['message']);
    }

Comments

joehudson’s picture

on the subject of email templates, it would also be handy to have direct access to the sid, not just the submission url.
so added:
$replacements['safe']['%sid'] = ($submission?$submission->sid:'');
in webform_filter_values()

quicksketch’s picture

Status: Active » Closed (won't fix)

I won't be adding PHP evaluation to any end-user interface. Use theming.