I am coding a simple wordpress plugin that has the following action:
add_action( 'wp_mail_failed', 'aetMailError' );
function aetMailError( $wp_error ) {
update_option('aet_mail_error' , $wp_error->get_error_message( 'wp_mail_failed' ) );
}
But I tried to display the get_option('aet_mail_error') value after the email failed to send but the value is empty..
Can anyone enlighten me if i am saving the error message $wp_error correctly?
Appreciate any help, thank you!