Email setup in WooCommerce

Hosting Mautic QuickStart -50% with support in Spanish
24 hours and free training

Send up to 1,000,000 emails/year. Mautic support in Spanish 24 hours, 365 days

If you have just finished your online store, on which you have been working for the last few months, and as soon as you inaugurate it and open it to the public, you discover that you are not receiving sales emails, notifications, etc., this article is for you.

Not receiving an email from a sale in your new , I think it’s like say i love you to someone, and they say “thank you”.

Throughout this article I will guide you through the process of configuring the WordPress SMTP, to ensure that the emails from your WooCommerce online store reach your inbox correctly (and that of your clients).

PHP vs. SMTP

By default, when you clean install WordPress, the system uses one of those weird things about WordPress that you don’t have to know up front: “PHP mail function“.

Although this function is fine for a basic website, without many notifications, not the most ideal for an online store.

This is because WordPress is not a native email application, as you might imagine (it’s not Gmail, Outlook, Hotmail, etc).

This is why sometimes, WordPress mail goes directly to the SPAM folder in your inbox or that of your clients.

To fix this, or at least to fight itit is recommended to use the SMTP (Simple Mail Transfer Protocol in English), which is something like a bridge between your WordPress website and a real email service (which is professionally called a third-party mail service).

This type of protocol does not come by default with WordPress, and you have to configure it. But don’t worry (I already imagine you with your hands on your head and sweating):

  • Is easier than it looks like
  • I explain it to you in video at the end of the article
  • It’s free

What this protocol does is allow you, once properly configured, to send emails from your Gmail (or the one you prefer), with your own corporate email (and not one of those rare emails from the server you use).

What is SMTP and why do you need it in WooCommerce?

As a pure technical definition, SMTP is a protocol used for electronic mail. outgoingand it is used precisely to send any type of email, with any content, to whom it corresponds.

Typically speaking, in WooCommerce, you want to have SMTP enabled for:

Mail notifications for the administrator:

  • New order.
  • Order cancelled.
  • Failed request.

Mail notifications for the client:

  • Waiting order.
  • Order being processed.
  • Order completed.
  • Order with refund.
  • Customer Receipt / Order Details.
  • Note to the client, by the administrator / seller.
  • Password reset.
  • New account created successfully.
See also  Best plugins to integrate Instagram in WordPress

It is interesting that you learn more about your new friend the protocol, knowing all its functions, and investigating the usual configurations with different known mail providers.

Check possible problems with emails in WooCommerce

There are many reasons why you might not actually be receiving WooCommerce emails in your inbox.

There is a way to automatically check if the emails from your website are being sent correctly

This is done through a very simple plugin to configure, called .

When installing it, go to the section of Tools in your control panel at wp-adminin order to use it.

All you have to do is enter a valid email (to be able to verify the email that is sent as a test) and hit the blue button Send test email. You don’t need to touch any other settings.

If your website works well, as far as sending emails is concerned, you will receive an email in the inbox of the email that you have written for the test.

Of course, this does not mean that you are using SMTP. That’s why you should continue reading this article if you don’t receive the test email, or if you do receive it but want to configure SMTP to send emails with WooCommerce at once. more reliable way that with what comes by default in WordPress.

The other (rather more obvious) way to check if your website sends emails to you and your customers or not is check the SPAM folder.

This would be another compelling reason to configure SMTP on your WooCommerce website.

WooCommerce Specific Settings

This point is to describe to you the different areas of WooCommerce that touch on email notifications.

You have to make sure that each of them works correctly:

  • orders: WooCommerce -> Emails.
  • Emails for inventory: WooCommerce -> Products -> Inventory.
  • The website in general: Settings -> General
  • contact forms: here it depends on what you use. I recommend .

On the other hand, if you check the , you will see at a glance the options that the plugin offers you, for emails (we see it in a video below).

In WooCommerce, the options for emails are divided into the individual customization of each of the emails that WooCommerce sends, and that we have seen above:

And on the other hand the aesthetic aspect of these emails:

Next, and with a view to configuring the SMTP for your WooCommerceI describe how do it manually (way above, since we are not interested in this article), and with a plugin (which is what is really going to get us out of trouble).

See also  Hamburger Menu -

Do it yourself: code

For good practices, in WordPress you have to use the minimum number of plugins possible.

This is achieved using your own code, but this entails expanding the range of possible errors that your website has, and you will not have anyone “support” to solve them.

Hence, as I always mention in my articles, I like to use quality plugins, whether free or paid, with a good support team or community behind it.

However, if you want to venture into SMTP configuration on your own, instead of using a third-party plugin, you can use the WordPress-APIs to develop your own code.

To send notifications from your WooCommerce store by email, copy and paste the following code into the file wp-config.phpreplacing the example content with your specific content.

define( ‘SMTP_HOST’, ‘server.example.com’ ); // The name of the hosting you use // define( ‘SMTP_AUTH’, true ); define( ‘SMTP_PORT’, ‘465’ ); define( ‘SMTP_SECURE’, ‘ssl’ ); define( ‘SMTP_USERNAME’, ‘user@example.com‘ ); // The SMTP authentication user // define( ‘SMTP_PASSWORD’, ‘password’ ); // The SMTP authentication password // define( ‘SMTP_FROM’, ‘user@example.com’ ); // From which email the email is sent // define( ‘SMTP_FROMNAME’, ‘Fulanito Menganito‘ ); // The Name of the person sending said email //

And in your own plugin code, use the following code:

add_action( ‘phpmailer_init’, ‘send_smtp_email’ ); function send_smtp_email( $phpmailer ) { $phpmailer->isSMTP(); $phpmailer->Host = SMTP_HOST; $phpmailer->SMTPAuth = SMTP_AUTH; $phpmailer->Port = SMTP_PORT; $phpmailer->SMTPSecure = SMTP_SECURE; $phpmailer->Username = SMTP_USERNAME; $phpmailer->Password = SMTP_PASSWORD; $phpmailer->From = SMTP_FROM; $phpmailer->FromName = SMTP_FROMNAME; }

And to send an email, use the function wp_mail(). For example:

wp_mail(“recipient@example.com”, “Subject”, “Message”);

But let’s be honest: if you knew how to do all this, You wouldn’t even be reading this article.

That is why, as I mentioned at the beginning, I am going to “skip” this section a bit, since what is interesting is to use a third-party plugin, in our case.

Let someone else do it for you: WP Mail SMTP Plugin

There are several plugins that configure the SMTP in WordPress, but the one that is most often mentioned in Google, and the one that I personally use with my clients, is the one of .

This plugin has been developed by the direct competition of Gravity Forms, those of WPForms.

Ironically, I use Gravity Forms more, which sends the emails thanks to WPForms. (Like drinking Coca Cola in a glass of Pepsi).

But jokes aside, the steps to follow to configure this plugin (although we see it in detail in the video below), are:

  • Step 1: Find the SMTP settings for your server. For example, I am going to show you where to find this information as a Webemrpesa client, with a guide to , in WePanel.
  • Step 2: Install in WP Mail SMTP plugin
  • Step 3: Enter the necessary data in the plugin (we see it in the video)
  • Step 4: Send a test email
  • Step 5: Verify that the email is sent correctly
See also  place 3 or 4 images horizontally and with space between them...

When you activate the WP Mail SMTP plugin, you will find the following options, which we discuss in detail in the video as well:

  • Sender email – the email address from which you want the emails to be sent, for example email@yourdomain.es.
  • Sender name – The name under which your emails will be sent.
  • Return route – Check if you want the return route of your emails to be the same as the sending email account;
    • SMTPHost – the name of your SMTP server;
    • SMTP Port – the port used by your server;
    • encryption – If you have SSL/TLS encryption available on your server, select it here;
    • Self TLS – If your server supports TLS encryption, activate this option;
    • Authentication – check if your SMTP server requires authentication;
    • Username – The username of your SMTP server;
    • Password – the password of your SMTP server;
  • email service – In our example we are going to configure the WePanel in .

Once you have configured these parameters, you just have to click on the save settings button from the bottom of the page.

Review video tutorials

And once all the theory has been written, and well chewed and digested by you (I recognize that this article is quite technical, so let’s take a deep breath)… now comes the practice.

let’s see first what options woocommerce throws As for email itself, and where its settings are located:

Here I leave you the one to add to WooCommerce emails, as I mentioned in the video.

And now I’m going to explain the WP Mail SMTP Plugin itself, so you can see the configuration and general appearance:

Conclusions

As you may have deduced, WordPress, and especially the use of the WooCommerce plugin, is not the ideal scenario for sending emails (as it comes by default).

This is solved by configuring something more professional, such as the SMTP Protocol, by using a free and easy plugin to configure with your favorite email client.

This will solve the problem of “reaching the SPAM folder”, or directly the problem that you or your customers do not receive any type of email from your online store.

I hope you have enjoyed reading and putting this article into practice, and that you have been able to advance in your WordPress project, making everything work…

Loading Facebook Comments ...
Loading Disqus Comments ...