gpdtc_send_delta_warning_admin_email
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:
false
$field \GF_Field
Current field object
$form array
Current form array
$entry array
Current entry
Example
Send email to site admin
This example tells GP Date Time Calculator to send 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 = true;
}
return $send_email;
}, 10, 4 );
Since
This filter is available since GF Date Time Calculator 1.0-beta-4.0.