Here at my school, a lab is using drupal as their front end with a request form when people need some analysis done. The idea was to have a unique identifer for each submition since we will have repeat users and using their name or email isnt useful. I'm not a developer so I hacked up the webform module to include the following in the webform.module file:
function webform_help($section= "admin/help#webform") {
$output= "";
....
case 'webform/helptext#variables' :
$output = t('Available variables are: %username, %useremail, %site, %date, %uniqueid.');
....
and
function _webform_filtervalues($string, $strict = TRUE) {
global $user;
// Setup default token replacements.
$find = array('%username', '%useremail', '%site', '%date', '%uniqueid');
$replace = array($user->name, $user->mail, variable_get('site_name', 'drupal'), format_date(time(), 'large'), md5(uniqid(time(),true)));
....
We then use this unique id to identify and distinguish each submission.
Comments
Comment #1
quicksketchEach submission already includes a unique id that is used in the database. Unfortunately because the submission is inserted after the additional processing code, the ID isn't yet available at the point of doing additional processing. However, in both the emails sent and on the confirmation page, the SID is available. On the confirmation page you can get the SID by checking $_GET['sid']. In the emails sent, you can find the SID at the bottom of the email.
Comment #2
quicksketchComment #3
rokrIs there another way to insert a unique number (or SID) to a confirmation E-Mail?
Something like: "Thank you! Your reservation number is ... "?
All i want is to use SID in a more usable way inside the E-Mail, not only at the end as part of the link.
Thanks, Ronald
Comment #4
quicksketchThe SID is available in the webform-mail.tpl.php file, just print out $sid where you want it to appear.