function hook_webform_submission_insert

nittany7 webform.api.php hook_webform_submission_insert($node, $submission)

Respond to a Webform submission being inserted.

Note that this hook is called after a submission has already been saved to the database. If needing to modify the submission prior to insertion, use hook_webform_submission_presave().

Parameters

$node: The Webform node on which this submission was made.

$submission: The Webform submission that was just inserted into the database.

Related topics

1 function implements hook_webform_submission_insert()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

webform_webform_submission_insert in modules/contrib/webform/webform.module
Implements hook_webform_submission_insert().
1 invocation of hook_webform_submission_insert()
webform_submission_insert in modules/contrib/webform/includes/webform.submissions.inc
Insert a webform submission entry in the database.

File

modules/contrib/webform/webform.api.php, line 133
Sample hooks demonstrating usage in Webform.

Code

function hook_webform_submission_insert($node, $submission) {
  // Insert a record into a 3rd-party module table when a submission is added.
  db_insert('mymodule_table')->fields(array(
    'nid' => $node->nid,
    'sid' => $submission->sid,
    'foo' => 'foo_data',
  ))->execute();
}