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.

CommentFileSizeAuthor
#5 webform_mail_sid.patch737 bytesquicksketch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Title: Include Submission ID in email and confirmation message through UI » Provide a Submission ID token (%sid)
Category: support » feature
Priority: Critical » Normal

Oddly 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.

Iowagirl’s picture

I 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.

<?php print t('Submitted on %date'); ?>
<?php if ($user->uid): ?>
<?php print t('Submitted by user: %username'); ?>
<?php else: ?>
<?php print t('Submitted by anonymous user: [%ip_address]'); ?>
<?php endif; ?>
<?php print t('Entry Information') ?>:
%email_values
<?php print $submission->sid; ?>",
Iowagirl’s picture

Just 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.

quicksketch’s picture

Category: feature » support
Status: Active » Fixed

Oh, 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).

quicksketch’s picture

FileSize
737 bytes

Here's patch I made to webform-mail.tpl.php, removing our errant documentation.

quicksketch’s picture

Title: Provide a Submission ID token (%sid) » Printing out SID in confirmation and mail templates

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.