Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I would like to be able to utilize the confirmation message and email templates through the UI to send the submission ID. I would prefer not to do this via the tpl file.
Is this possible?
If not what would the code by to use the tpl file.
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#5 | webform_mail_sid.patch | 737 bytes | quicksketch |
Comments
Comment #1
quicksketchOddly we don't yet have a %sid token (but we do have %submission_url), so this isn't possible through the UI. In a .tpl.php file, you can simply use
<?php print $submission->sid; ?>
.I'm moving this to a feature request.
Comment #2
Iowagirl CreditAttribution: Iowagirl commentedI appreciate your fast response. So am using the .tpl file but it is not provided the ID.
I know that the tpl is correct because I can see the updated text changes that I've made.
Comment #3
Iowagirl CreditAttribution: Iowagirl commentedJust wanted to follow up on this. I actually added this information to the email tpl and it doesn't work. Ironically the same exact code works for the confirmation tpl file.
<?php print t('Your Entry Number is:'. $sid) ?>
Any help would be GREATLY appreciated.
Comment #4
quicksketchOh, we've already got an issue for adding %sid. See #712060: Allow tokens in the redirect URL field.
In webform-mail.tpl.php, you should be able to do this:
<?php print t('Your Entry Number is:'. $submission->sid) ?>
I've removed $sid from the PHPdoc at the top of webform-mail.tpl.php, since it doesn't actually exist (but $submission does).
Comment #5
quicksketchHere's patch I made to webform-mail.tpl.php, removing our errant documentation.
Comment #6
quicksketch