Sending a notification when you update a Gravity Forms entry is fairly simple but you’ll need to write some custom code. Modify the following example to suit your needs and place in your theme’s functions.php file.
To send a notification when a Gravity Forms entry is updated, you need to code two things. First, you need to add an ‘update’ event to the dropdown of events available when creating a notification. Second, you need to trigger the event when an entry is updated.
To add an ‘update’ event to the dropdown, filter the array/list of events and add your ‘update’ event:
// After update entry event add_filter('gform_notification_events', 'az_form_events', 10, 2); function az_form_events($events, $form) { // Optionally only add to specific forms if ($form['id'] == 24) { $events['update'] = 'Entry is updated'; } return $events; }
To trigger the notification:
add_action('gform_after_update_entry', 'az_after_update_entry', 10, 2); function az_after_update_entry($form, $entry_id) { // Optionally only trigger the event on specific forms if ($form['id'] == 24) { \GFAPI::send_notifications($form, \GFAPI::get_entry($entry_id), 'update'); } }
Next you can create a notification, selecting your newly created ‘Entry is updated’ event as the trigger. (NOTE: you can also make the notification conditional based upon a value in the form. For example, you might have a ‘Job completed’ checkbox and only send the update notification if that box is checked.)
Add the code to your functions.php file in your active theme and that’s it!
As always, contact us if you need custom code. Our rates are competitive and our turn around time is fast.