This PR adds a new filter named, wp_mail_logging_before_log_email which passed the $mailArray (an array containing the mail data) before it's saved.
This will give the developers the ability to manipulate the mail data before it's saved. One such use case is to remove sensitive data as described in #124.
Testing procedure
Add this snippet in your functions.php or anywhere where it will run.
add_filter( 'wp_mail_logging_before_log_email', 'wp_mail_logging_before_log_email' );
function wp_mail_logging_before_log_email( $mail ) {
$mail['to'] = 'john.doe@test.com';
$mail['message'] = 'This is a test';
$mail['subject'] = 'Lorem';
return $mail;
}
Trigger an email send in your WordPress that WP Mail Logging will capture/
Check the Email Logs. You should notice that the email saved contains the data that we manipulated instead of the original data.
Description
This PR adds a new filter named,
wp_mail_logging_before_log_email
which passed the$mailArray
(an array containing the mail data) before it's saved.This will give the developers the ability to manipulate the mail data before it's saved. One such use case is to remove sensitive data as described in #124.
Testing procedure
functions.php
or anywhere where it will run.