Created
November 7, 2013 08:36
-
-
Save lifedraft/7351155 to your computer and use it in GitHub Desktop.
Using drupal's webform_token module to replace values of confirmation message. e.q: Congratulations, [webform:val-salutation]. [webform:val-last_name]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hook_preprocess_webform_confirmation(&$vars) { | |
module_load_include('inc', 'webform', 'includes/webform.submissions'); | |
$node = $vars['node']; | |
$webform = $node->webform; | |
$submission = webform_get_submission($node->nid, $vars["sid"]); | |
$confirmation = $node->webform['confirmation']; | |
$confirmation = token_replace($confirmation, array('webform' => $submission), array('webform_tokens')); | |
$vars['confirmation_message'] = $confirmation; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment