Drupal - How to use [submission:values] in Email template in Webforms
I haven't such problem, but I know, how to get special values from webform.
Webform tokens from submitted data. Includes the value and field label. Replace the "
?
" with the "Field Key". Append ":nolabel
" for just the value.
So, you can use [submission:values:?:nolabel]
, where ?
is field key of your component.
Name: [submission:values:name:nolabel]
Address: [submission:values:address:nolabel]
For me result is the same as for [submission:values]
:
Name: Kate
Address: Moscow, Russia :)
Webform version: 7.x-4.0-alpha6 (7404).
Webform Tokens module is not needed.
Update
If you are using HTML mail, labels are outputted via theme_form_element_label
and look like <label>Title</label>\n
.
You can override webform-submission.tpl.php
. Copy this file to the theme for rendering the emails from admin/config/system/mailsystem
.
To add :
I suggest just to modify render array:
if ($format == 'html') {
foreach ($renderable as $i => $item) {
if (is_array($item) && !empty($item['#title'])) {
$renderable[$i]['#title'] .= ':';
}
}
}
print drupal_render_children($renderable);
But you can output substitutions fully yourself.