You are here

function hook_webform_submission_create_alter in Webform 7.4

Respond to the creation of a new submission from form values.

This hook is called when a user has completed a submission to initialize the submission object. After this object has its values populated, it will be saved by webform_submission_insert(). Note that this hook is only called for new submissions, not for submissions being edited. If responding to the saving of all submissions, it's recommended to use hook_webform_submission_presave().

Parameters

$submission: The submission object that has been created.

$node: The Webform node for which this submission is being saved.

$account: The user account that is creating the submission.

$form_state: The contents of form state that is the basis for this submission.

See also

webform_submission_create()

Related topics

1 invocation of hook_webform_submission_create_alter()
webform_submission_create in includes/webform.submissions.inc
Given set of $form_state values, prepare a psuedo-submission.

File

./webform.api.php, line 123
Sample hooks demonstrating usage in Webform.

Code

function hook_webform_submission_create_alter(&$submission, &$node, &$account, &$form_state) {
  $submission->new_property = TRUE;
}