diff --git a/includes/webform.submissions.inc b/includes/webform.submissions.inc index 96422aa..2510a2b 100644 --- a/includes/webform.submissions.inc +++ b/includes/webform.submissions.inc @@ -181,6 +181,8 @@ function webform_submission_send_mail($node, $submission, $emails = NULL) { // Get the list of e-mails we'll be sending. $emails = isset($emails) ? $emails : $node->webform['emails']; + $submission->is_email = TRUE; + // Create a themed message for mailing. $send_count = 0; foreach ($emails as $eid => $email) { diff --git a/webform.module b/webform.module index 8f77582..d74f078 100644 --- a/webform.module +++ b/webform.module @@ -1147,6 +1147,11 @@ function webform_webform_submission_render_alter(&$renderable) { // are being displayed. $node = $renderable['#node']; $is_admin = webform_results_access($node); + // Fake the admin account so that the fields are accessible by token replace + // when sending a email. + if (!$is_admin && !empty($renderable['#submission']->is_email) && $renderable['#submission']->is_email) { + $is_admin = TRUE; + } if (empty($renderable['#email']) && !$is_admin) { // Find and hide the display of all hidden components. foreach ($node->webform['components'] as $cid => $component) {