Description
Filter whether an e-mail should be sent to the site admin e-mail if GP Date Time Calculator detects a deviation between the frontend and backend calculations that exceeds the max delta.
Usage
add_filter( 'gpdtc_send_delta_warning_admin_email', 'my_custom_function', 10, 4 );
Parameters
$send_email boolean
true
to send e-mail,false
to not send e-mailDefault:
true
$field \GF_Field
Current field object
$form array
Current form array
$entry array
Current entry
Example
Stop the email from being sent to site admin
This example stops GP Date Time Calculator from sending an email to the Site Admin when it detects a deviation between the frontend and backend calculations for a specific Form and Field.
add_filter( 'gpdtc_send_delta_warning_admin_email', function( $send_email, $field, $form, $entry ) {
// Change 123 to the form ID and change 10 to the field ID
if ($form['id'] == '123' && $field['id'] == '10'){
$send_email = false;
}
return $send_email;
}, 10, 4 );
Since
This filter is available since GF Date Time Calculator 1.0-beta-4.0.