Closed (fixed)
Project:
Webform
Version:
7.x-3.18
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Dec 2012 at 16:26 UTC
Updated:
2 Jul 2013 at 06:00 UTC
In the email, the standard value for %email_values is
field_name: field_value, e.g. Company: XYZ Corp.
I'd like it to be
field_name=field_value, e.g. Company=XYZ Corp.
How can I tweak the template to make that substitution?
I assume I'll need to use the str_replace command in the php template but, being a bit of a newb with respect to php, I don't know where to put it.
Thanks in advance for your help.
<?php
/**
* @file
* Customize the e-mails sent by Webform after successful submission.
*
* This file may be renamed "webform-mail-[nid].tpl.php" to target a
* specific webform e-mail on your site. Or you can leave it
* "webform-mail.tpl.php" to affect all webform e-mails on your site.
*
* Available variables:
* - $node: The node object for this webform.
* - $submission: The webform submission.
* - $email: The entire e-mail configuration settings.
* - $user: The current user submitting the form.
* - $ip_address: The IP address of the user submitting the form.
*
* The $email['email'] variable can be used to send different e-mails to different users
* when using the "default" e-mail template.
*/
?>
<?php print ($email['html'] ? '<p>' : '') . t('Submitted on %date'). ($email['html'] ? '</p>' : ''); ?>
<?php if ($user->uid): ?>
<?php print ($email['html'] ? '<p>' : '') . t('Submitted by user: %username') . ($email['html'] ? '</p>' : ''); ?>
<?php else: ?>
<?php print ($email['html'] ? '<p>' : '') . t('Submitted by anonymous user: [%ip_address]') . ($email['html'] ? '</p>' : ''); ?>
<?php endif; ?>
<?php print ($email['html'] ? '<p>' : '') . t('Submitted values are') . ':' . ($email['html'] ? '</p>' : ''); ?>
%email_values
<?php print ($email['html'] ? '<p>' : '') . t('The results of this submission may be viewed at:') . ($email['html'] ? '</p>' : '') ?>
<?php print ($email['html'] ? '<p>' : ''); ?>%submission_url<?php print ($email['html'] ? '</p>' : ''); ?>
Comments
Comment #1
ruben_vreeken commentedI'm guessing you have to pull the submitted data out of the $submission var.
I'm working on a custom mail template too, if I figure out how it works I'll get back here with a more detailed answer.
Comment #2
quicksketchUltimately this comes from theme_webform_element_text(). You can override this function in your theme's template.php if you would like to change the colon to an equals sign.