function hook_webform_submission_insert in Webform 6.3
Same name and namespace in other branches
- 7.4 webform.api.php \hook_webform_submission_insert()
- 7.3 webform.api.php \hook_webform_submission_insert()
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 invocation of hook_webform_submission_insert()
- webform_submission_insert in includes/
webform.submissions.inc - Insert a webform submission entry in the database.
File
- ./
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_query("INSERT INTO {mymodule_table} nid = %d, sid = %d, foo = '%s'", $node->nid, $submission->sid, 'foo_data');
}