Add filter saving log
-
Hello,
Is it possible to add a filter in the save_email_log method to define if the email must be logged (example: email to admin, password reset…)?
By default, the filter would be set to true.Add this to line 531 in src/WPML_Plugin.php
$save = apply_filters( 'wp_mail_logging_save_log_email', true, $mail_data );
if (!$save) {
return $mail_data;
}In any files of a plugin or theme, you can do the following, for example
add_filter('wp_mail_logging_save_log_email', function($save, $emailData) {
if ($emailData['to'] == get_option('admin_email')) {
return false;
}
return $save;
}, 10, 2);Best regards,
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Add filter saving log’ is closed to new replies.