I'm using Rules to send an e-mail every time a webform is completed.

One of the data parameters I would like to send is the Webform Serial number (not the SID) but cannot find which replacement pattern to use.

I've tried the following with no success:

[submission:serial]
[webform:serial]
[data:serial]

Any help is apprecaited.

Thanks!

Comments

penone created an issue. See original summary.

kyleheney’s picture

Also looking for a hand with this issue! Any help is appreciated!

VladoVy’s picture

StatusFileSize
new12.51 KB

update for webform_rules.module

Line 116...

  $webform = $node->webform;
  $data = array(
    'op' => $op,
    'sid' => $submission->sid,
+    'serial' => $submission->serial,
    'components' => array(),

Line 163...

  $webform['sid'] = array(
    'name' => t('Submission Id'),
    'description' => t('The unique identifier of the submission.'),
  );
+  $webform['serial'] = array(
+    'name' => t('Submission Serial'),
+    'description' => t('Serial Number of the submission.'),
+ );
  $webform['data'] = array(
    'name' => t('Submitted data'),
    'description' => t('The submitted webform data.'),
  );

Line 220...

      if ($name == 'sid') {
        $replacements[$original] = $data[$type]['sid'];
      }
+      elseif ($name == 'serial') {
+        $replacements[$original] = $data[$type]['serial'];
+      }      
      elseif ($name == 'data') {
        $replacements[$original] = webform_rules_prepare_component_value($data[$type]);
      }
matt b’s picture

@VladoVy's changes work for me.... can now use [data:serial]

igonzalez’s picture

It works perfectly.
Please add it to the stable version.

Good job.

Marty_S’s picture

Assigned: Unassigned » Marty_S
Marty_S’s picture

Assigned: Marty_S » Unassigned
Status: Active » Needs review
StatusFileSize
new1.27 KB

Added this lines of code above to patch)

igonzalez’s picture

The patch should be like this.

Good job

igonzalez’s picture

Status: Needs review » Reviewed & tested by the community
beder’s picture

After installing the patch in version 1.7, an error message appears.

Warning: Undefined array key "serial" in webform_rules_tokens() (Zeile 251...

The array should be defined with the patch, where does it still go wrong?