When I track KPIs, or performance indicators of a campaign of email marketingallows us to analyse its performance: at the top of the "pyramid", of the funnel of email marketing is the rate of delivery o Deliverability: if an email does not arrive in the recipient's inbox, due to a soft bounce or hard bounce.In every case, if your email is not delivered, it will not be opened, clicked, or even generate a conversion.
One way to understand any delivery information and errors, but also other aspects of sending our newsletters, are Email Logs.
In the case of Email Logs, these are logs, which store data for 30 days on average and contain information about each email, such as:
- sender and receiver
- date and time
- state of delivery
- any error codes
Let's look at some practical applications of email logs analysis.
- if you notice bounces in your email logs at specific date intervals, the cause could be incorrect domains, outdated addresses, your email templates;
- reputation in deliverability is important: regularly searching email logs for delivery errors is a great way to monitor for performance issues, keep your lists clean (also through email cleaning software like MailFloss) to maintain an IP address with a good reputation and avoid blacklisting;
Email logs can also be useful in other cases, such as make sure the email is delivered: if a visitor contacts you and tells you that they did not receive an email they were expecting, you can check the email log.
What emails does WordPress send?
WordPress sends default emails and others if WooCommerce is active, such as:
- Password reset;
- Email notification of new WordPress accounts.
- WooCommerce emails (such as orders, payments, invoices).
- Sending emails generated by contact forms with plugins such as Gravity Forms, ElementorNinjaForms.
There may be other types of emails sent from WordPress, sent using wp_mail, which allows you to track them.
The WordPress email log is essential for tracking the overall delivery of all your sent emails
Now that we've seen what email logs are and what the benefits are, let's see how to create Email Logs To track emails sent with 2 tools for WordPress: WP Mail SMTP and WP Mail Logging.
Email Logs with WP Mail SMTP
Implementing and viewing email logs with WP Mail SMTP is simple and consists of 3 steps:
- Install the WP Mail SMTP plugin
- Enable WordPress email logs
- View WordPress email logs
Once you enable email logging, the WordPress database will keep track of all emails sent from your site. Let's look at these points in detail.
1. Install the WP Mail SMTP plugin
First, install and activate the WP Mail SMTP plugin on your WordPress site.
The White Glove Setup option, allows the WP Mail SMTP team to manage the configuration and testing of your mailer.
Once you've activated the WP Mail SMTP plugin, you need to go to the WordPress dashboard and enable email logs.
2. Enable WordPress email logs
From your WordPress dashboard, go to WP Mail SMTP > Settings. Then, click the Email Log tab.
From the Email Log page, you'll see an option called Enable Log. It's an option that keeps a record of every email sent from your site in the future.
With this option the details for each WordPress log will include:
- Email status (lets you know if it has been sent successfully)
- Date and time of sending
- Recipient's email address(es) (including CC and BCC)
- Number of attachments (in case you have set the forms to accept multiple attachments)
- Additional technical details (such as content type, MIME)
Moving forward, under the Enable Log option is a second option called Email Log.
The "Keep a record of basic details for all emails sent" will store all the content of emails sent from your site, which you will be able to find in the logs.
All email content will be stored as plain text (unencrypted) in your site's database, which could lead to an increase in database size or create security risks.
3. View WordPress email logs
To view WordPress email logs, click on WP Mail SMTP > Email Log on the left side of the WordPress admin menu. The most recent emails will be shown at the top of the list.
If you want to see more details about a particular email, click on the subject line. A page for that individual log will open.
Email Logs with WP Mail Logging
Similar to the previous one, the WP Mail Logging plugin also allows email logging in 4 steps.
WP Mail Logging is a free and popular plugin with over 70 thousand active installations, which logs all emails using the wp_mail feature.
1. Install WP Mail Logging
Search for, install and activate "WP Mail Logging" from the Plugins section of WordPress.
2: Have WordPress send an email
The next step is to have WordPress send you an email, such as resetting your password, which allows a reset link to be sent.
You should see the reset email in the next step.
3: View WordPress email logs
WP Mail Logging logs all emails on your site using wp_mail function, defined "an internal function used by WordPress to send emails from your site that acts as a wrapper for the standard PHPMailer class“.
Although many plugins use wp_mail, some plugins like MailPoet send emails using other systems, which in any case will be recorded by WP Mail Logging.
To see your logged emails, go to wp-admin > WP Mail > Log.
WP Mail Logging, among other features:
- shows headers and errors;
- doesn't show if the email was delivered (we'll recommend a plugin for this later);
- shows if the email was sent by WordPress (if wp_mail didn't encounter any errors when sending it).
4: View the headers of a sent email
Header monitoring allows you to discover any delivery errors. By clicking "view" at the message shown above, WP Mail Logging shows in 3 formats including html and json, information about the sent email such as:
- time and date
- host address
How to check if WordPress sends emails
An email registered with wp_mail means that wp_mail was able to correctly create the email and attempt to send it, not necessarily that it was or delivered. The easiest way to verify delivery is to use a plugin like Check Email. If there are delivery issues, you might want to use an SMTP plugin to route your WordPress emails through Amazon SES, Sendgrid, or any other SMTP provider.