Welcome! This is Part 2 of a 3 part series taking a deep dive into troubleshooting Ninja Forms email notifications. If you’re struggling with getting your email notifications working properly, you’re in the right place- maybe. If you haven’t seen Part 1 already, definitely start there. In Part 1 we explained how email in WordPress is sent and how to troubleshoot the Ninja Forms email notification action itself.
As a reminder, this is the life of an email that begins in your Ninja Forms email notification:
- You configure your email notification action in your Ninja Form.
- When a user hits submit on the form, the email data you have configured in the Ninja Forms email notification action is passed to your WordPress installation using WordPress’ wp_mail function. This is not yet an email, but a package of raw data. WordPress then passes that raw email data off to your web host using the host server’s phpmailer mail function.
- Your host takes the email data that’s passed to it, turns the raw email data into an actual email, and sends it off to the email client specified by the user via the email address they entered into your form.
Today in Part 2 we’re going to be looking at Step 2: what can go wrong as your email action data is passed through WordPress and to your host. This will be the shortest section because, well, WordPress is awesome and there’s just not a lot that can go wrong here. Everything breaks sometimes though, so let’s look at how this step can break and what you can do about it!
Step 2: A WordPress Well Visit
WordPress needs regular checkups just like our children do. This is a bit easier though as there is no checking WordPress out of school, collecting …erm, samples… or giving it shots. Hooray! There are very rarely errors in your WordPress install that will impact email, but it’s worth a look to make sure.
First of all, make sure WordPress (and Ninja Forms!) is up to date. Ninja Forms is tested with each new WordPress version before it’s ever released to the public. Changes are sometimes made to WordPress that necessitate changes on our end. Keeping both WordPress and Ninja Forms on its most current version reduces your chances of bad behavior.
Secondly, make sure your PHP version is kept up to date. PHP plays an instrumental role in the life of an email. If you have an outdated version of PHP running your website you could be opening yourself up to not just issues with email and plugin conflicts, but major security breaches as well. You can check to see the most recent version of PHP at the top of this page, but you’re probably going to need to contact your host to have them update to that version. To find out what version you’re running on your website, you can check your system status report in your dashboard at Forms>Get Help>Get System Status.
A Neat and Maybe Helpful Tool
If only there were ways to get eyes on this whole process to help determine where the problem is, right? There is, sort of. Mail loggers are a tool that will register, in our case, each time WordPress’ wp_mail function is passed data from Ninja Forms.
You can use a mail logger to narrow down the focus of your troubleshooting. All email data is passed from Ninja Forms to WordPress via the wp_mail function, so a mail logger can tell you if your email data has been handed off or not.
Post SMTP is not only an excellent SMTP plugin, it also has a mail logger feature. WP Mail Logging is a reliable and widely used standalone logging specialist. There are other options out there as well. Using one of these may help you isolate exactly what you need to be focusing on in your troubleshooting.
We’re off to looking at what happens once wp_mail() hands your data off to your host next, and what you can do to determine if that’s where your issue lies. Hopefully you’re good to go by now and will never see Part 3, but if not I’ll catch you there!