Drupal - Webform Theme submission_url Token

Category: 

After spending some time trying to figure out how to theme and/or preprocess the %submission_url provided by Webform during an e-mail notification, it appears it is not possible until the 4.x version of the module is out where Webform 'tokens' will become actual Drupal tokens (http://drupal.org/node/1001798).

I was not able to successfully use the following preprocess functions:
template_preprocess_views_slideshow_controls_text_next
template_preprocess_webform_mail_message
theme_webform_mail_message
The closest I got was with this hook:
hook_webform_submission_render_alter
But even in there, it was too late in the process to set the submission_url value. The value is set by the _webform_filter_values function, and it appears there is no opportunity to edit it.
 
I was just trying to change the 'http://' to an 'https://' on the submission_url, and wasn' able to accomplish it.
 
I suppose I could make a copy of webform-mail.tpl.php and place it inside my theme and use some code to accomplish it, but a preprocessor would've been nice to avoid extra template files.
 
Well today is a sad day, this is an article to just explain the problem, with no solution. If you have any ideas or updates on this, please leave a comment!

Comments

I just ran into the same requirement and also didn't find any solution trying to modify the submission URL token outside of webforms so I modified webform (7.x-3.18) to add a new %submission_url_secure token.

I've submitted a feature request issue with a patch, see https://drupal.org/node/2115179 if you still need this.

tyler's picture

Thank you for the information Alan, next time I run into this problem I'll be sure to check out your patch!

Add new comment