1. Home
  2. Actions
  3. Action reference: wpforms_process_complete

do_action( 'wpforms_process_complete', array $fields, array $entry, array $form_data, int $entry_id )

Action that fires at the very end of (successful) form entry processing.

Description

The wpforms_process_complete hook fires at the very end of form processing. It only fires if the entry was successful and did not contain errors. Saving the entry to the database and sending the email notifications are done prior to this hook running.

A popular choice when building custom API integrations or needing to perform any kind of action after an entry is successfully submitted (eg sending a custom email notification, creating a post or user account, etc).

An alternate version of this hook is available to easily limit by form ID, wpforms_process_complete_{$form_id}.

Important note: If you are doing processing and need to be able to return an error and prevent form processing, use wpforms_process hook instead.

Parameters

$fields
(array) Sanitized entry field values/properties.
$entry
(array) Original $_POST global.
$form_data
(array) Form settings/data.
$entry_id
(int) Entry ID. Will return 0 if entry storage is disabled or using WPForms Lite.

Source

wpforms/includes/class-process.php

More Information

For an example, see Bill Erickson’s Integrating your contact form with external services.

Updated on November 9, 2018

Was this article helpful?