Site icon PluginBuddy

WordPress Email Logging

The WordPress email logging helps to track emails sent from WordPress websites. It’s great for reviewing both the content and email headers. The PostBox WordPress email logging plugin saves emails sent from our WordPress website. Verify the email content or headers that are sent from any WordPress plugin. Woocommerce email logging helps the administrator, review the WooCommerce transaction emails.

How Do I See My WordPress Email Logs?

First, Install the PostBox WordPress email logging plugin.

Navigate to your WordPress admin dashboard > plugins and search “PostBox email log” as in the below image.

Finished, No more settings are needed. Now, It will automatically start to capture email data that is sent from your WordPress website.

Navigate to wp-admin > Email Logs.

Click on the row, and you’ll be able to view the entire details of the email. Inspect email header details like Bcc, Cc, From, Reply-to, etc from the headers tab.

How Does WordPress Mail Log Work?

The standard WordPress uses the wp_mail function to send emails. The filter hook wp_mail exists in wp_mail function. The PostBox plugin captures the data from the wp_mail filter.

	$atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) );

This code is available in postbox-email-logs/inc/email-logging.php

add_filter('wp_mail', array($this, 'logging'));
add_filter('wp_mail_failed', array($this, 'mail_failed'));

Where Is It Saving Emails Log Data

It saves to MySQL database postbox_email_log table. It has the following columns.

Exit mobile version