gform_before_resend_notifications

Description

The gform_before_resend_notifications filter is executed before resending notifications from the admin. You can use this to modify the form object, which is especially useful for changing the email subject or message.

Usage

The following would apply to all forms.

add_filter( 'gform_before_resend_notifications', 'your_function_name', 10, 2 );

To limit the scope of your function to a specific form, append the form id to the end of the hook name (format: gform_before_resend_notifications_FORMID).

add_filter( 'gform_before_resend_notifications_5', 'your_function_name', 10, 2 );
ParameterTypeDescription
$formForm ObjectThe form from which the entry was submitted.
$lead_idsarrayAn array of entry IDs.

Example

Change the Notification Subject When Resending

add_filter( 'gform_before_resend_notifications', 'change_subject', 10, 2 );
function change_subject( $form, $lead_ids ) {
	$original_subject = $form['notification']['subject'];
	$form['notification']['subject'] = 'Resending - ' . $original_subject;
	return $form;
}

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?

Source Code

This filter is located in GFForms::resend_notifications() in gravityforms.php