Category Archives: wp mail smtp

How to Get Email Notification for Post Changes in WordPress

Do you want to get email notifications for post changes in WordPress?

By default, WordPress doesn’t send notifications when posts are changed by a user. If you run a multi-author WordPress site, then you may want to stay informed about post changes on your website.

In this article, we will show how to get email notifications for post changes in WordPress.

How to Get Email Notification for Post Changes in WordPress

Why Set Up Email Notifications for Post Changes in WordPress?

If you’re the only one working on your own WordPress website, then it is easier to keep an eye on everything that is happening on your website.

However, if you have other authors writing blog posts, or SEO specialists optimizing blog posts for SEO, then you may want to keep an eye on the changes they make.

For instance, you may want to be alerted when a new post is published or if changes were made to an older article.

This also helps all team members be accountable. If they make a mistake, then it can be easily caught and remedied quickly.

That said, let’s take a look at how to get email notifications for post changes in WordPress. We’ll cover two methods so you can choose one that works best for you. We’ll also show you how to undo post changes and make sure your notification emails are delivered.

Method 1: Getting Notifications for Post Changes Using WP Activity Log

This method is recommended for all users as it is easy, powerful, and flexible.

The first thing you need to do is install and activate the WP Activity Log plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you’ll be asked to enter your license key. You can find this information under your account on the WP Activity Log website.

Add license key for WP Activity Log

Next, you’ll be given the option to run the setup wizard. You can answer a few quick questions to set up important monitoring and logging features.

All these things can be changed later in plugin settings too.

WP Activity Log setup wizard

Setting Up Email Notifications for Post Changes in WordPress

After that, you need to visit the WP Activity Log » Email & SMS Notifications page and switch to the ‘Content Changes’ tab.

Installing the Helper Plugin in WP Activity Log

You will see a message that a helper plugin is needed to enable SMS notifications.

If you want to receive SMS notifications as well as email notifications, then simply click the button labeled ‘Install the helper plugin’. You will finish setting up SMS notifications in the next step.

Now you need to select the events that will trigger notifications. The plugin comes with three default notifications covering most content changes.

Setting up content change notifications in WP Activity Log

Next to each event, you need to enter the email address the notifications should be sent to. In the next step, you will also add a mobile phone number if you want to get SMS notifications for post changes.

Finally, click on the ‘Save Notifications’ button to store your changes.

Setting Up SMS Notifications for Post Changes in WordPress

WP Activity Log allows you to easily receive SMS notifications for post changes and other WordPress activities. To do that, you’ll need a Twilio account and a phone number.

Twillio is a paid service with a pay-as-you-go pricing model for SMS messages. Pricing starts at $0.0079 per SMS, and you’ll also need to purchase a virtual phone number which will be used to send messages.

Simply go to the Twilio website and signup for a free trial account.

Sign up for a Twilio account

After setting up your account, you’ll reach the Twilio Console.

Here, you can copy your Account SID, Auth Token, and get a trial phone number.

Getting your Twilio credentials

Copy and paste these values to a text editor or leave this browser tab open.

Next, you need to switch back to your WordPress website admin area and visit the WP Activity Log » Settings page. From here, switch to the SMS Provider tab and enter your Twilio Account SID, Auth token, and number.

Entering your Twilio credentials

Don’t forget to click on the ‘Save Changes’ button to store your settings.

Now you can navigate back to WP Activity Log » Email & SMS Notifications and switch back to the ‘Content Changes’ tab. Here you can add a mobile phone number to get SMS notifications for post changes.

Entering the Phone Number for SMS Notifications

Testing Post Change Notifications with WP Activity Log

WP Activity Log allows you to easily test your post change notifications.

First, make sure you are on the ‘Content Changes’ tab of the WP Activity Log » Notifications page.

Test notifications in WordPress Activity Log

Now you can scroll down and click the ‘Test Notifications’ button.

This will bring up a popup window where you can enter an email address and a mobile phone number to send notifications.

Send test notifications

WP Activity Log will then send test notifications. If you do not receive an email notification right away, then you can jump to the section below on troubleshooting email notifications.

If you fail to receive SMS notifications, then check your Twilio credentials to make sure they are correct.

Method 2: Getting Notifications for Post Changes With Better Notifications for WP

This method is easy to use, but it doesn’t come with ready-made templates. While this method will send an email notification when a post is changed, you will have to write the email yourself and investigate the activity on your own.

First, you need to install and activate the Customize WordPress Emails and Alerts – Better Notifications for WP plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to visit the Notifications » Add New page to create your first custom notification.

Creating a post change notification

First, you need to provide a title for the notification. After that, you can choose a ‘Notification For’ option from the drop-down menu. This is the event that will trigger this notification, such as ‘Post Updated’ in the screenshot above.

If you like, you can check the ‘Additional Email Fields’ box so you can enter custom email addresses for the sender, cc, and more. If this option is left unchecked, then the plugin will simply use your default WordPress email settings.

Next, you need to select the users or user roles that will receive this notification under the ‘Send To’ option. Below that you can write the email subject and the message itself.

Setting up email settings

The Better Notifications for WP plugin doesn’t come with a template for post changes. This means you’ll need to write your own email message.

The plugin comes with a bunch of shortcodes that you can use to customize your notifications. You can view all of them by clicking on the ‘Find Shortcodes’ button.

Lastly, you need to click on the ‘Save’ button to store your email notification. Once you’ve done that, you’ll be able to click on the ‘Send Me a Test Email’ button to see if it is working.

Save and test your email notification

Better Notifications for WP is not an activity monitoring plugin. This means you’ll need to set up multiple notifications to cover different types of content changes in WordPress.

For instance, you may want to set up a ‘Post Published’ notification or another one for when a category or tag is changed.

The plugin also allows you to create custom notifications or modify default WordPress notifications as well. For more details, see our article on how to create better custom notifications in WordPress.

Revising and Undoing Post Changes in WordPress

Once you have received an email notification for post changes, you may want to see what changes were made, who made them, and when.

WordPress comes with a built-in revision management system that keeps track of all changes made to an article.

Simply edit the post or page that you want to review and then click on the ‘Revisions’ tab under the ‘Post’ settings from the right column.

Open revisions for a post or page in WordPress

This will bring you to the post revisions screen.

You can check the ‘Compare any two revisions’ box and then move the slider below to compare the changes.

Comparing revisions in WordPress

When you scroll down the post, you will see the changes between the two revisions highlighted in red and green colors.

If you don’t like the changes, then you can simply click on the ‘Restore This Revision’ button to undo them and return to the previous version.

Changes highlighted in revision history

For more details, see our guide on how to undo changes in WordPress with post revisions.

Troubleshooting Email Notifications in WordPress

By default, WordPress uses the PHP mail() function to send emails. This method does not use proper authentication (login or password) which means it can be easily misused. This is why most spam filters mark such emails as spam or block them altogether.

To fix this, you need to use a proper SMTP service provider to send out WordPress emails. There are even free SMTP servers like SendLayer, Gmail, Sendinblue, Sendgrid, and more that you can use with WordPress.

To set up SMTP, you need to install and activate the WP Mail SMTP plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

WP Mail SMTP allows you to connect your WordPress site to your SMTP service provider and send all your WordPress emails with much higher deliverability.

Upon activation, you need to go to the WP Mail SMTP » Settings page in your WordPress admin area to set up the plugin.

WP Mail SMTP license

First, you need to enter your license key. You can find this information under your account on the WP Mail SMTP website.

After that, scroll down to the ‘Mailer’ section to select your SMTP service provider. WP Mail SMTP will show all top SMTP service providers. You can click on your provider and then enter the required information below (usually an API key).

SMTP mailers in WP Mail SMTP

If your mailer is not listed, then you can simply choose ‘Other SMTP’ option and enter the required information.

To learn more, see our tutorial on how to fix WordPress not sending email issue.

We hope this article helped you set up email notifications for post changes in WordPress. You may also want to see our tips on getting more traffic to your blog and the best WordPress SEO plugins and tools to grow your website.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Get Email Notification for Post Changes in WordPress first appeared on WPBeginner.

How to Send Automated Coupons in WordPress to Bring Back Customers

Do you want to send automated coupons in WordPress to bring back customers?

By sending the right coupon to the right person at the right time, you can re-engage customers who are losing interest. This can get you more sales, create brand loyalty, and help you keep your best customers.

In this guide, we’ll show you a few different ways to send automated coupons in WordPress, and bring back customers.

How to send automated coupons in WordPress to bring back customers

Why Send Automated Coupons to Bring Back Customers?

You may have heard the saying that it costs five times more to get a new customer than keep an old one.

While lead generation will help grow your business, you also need to keep your existing customers happy. Over time, people may lose interest in your website, forget about your products, or start shopping with a competitor.

That’s where automated coupons come in.

The best WordPress automation tools and plugins can watch your customers for signs they’re becoming disengaged. For example, a customer may not place an order for 2 months or stop opening your emails.

One way to bring those customers back is to automatically send them a coupon code via email. By creating this automated workflow in WordPress, you can retain customers without having to do all the hard work yourself.

Pro Tip: If you send coupons via email, then you’ll need to make sure those messages land in the customer’s inbox and not in the spam folder. Here, a good SMTP service provider is essential for improving your email deliverability. We also recommend using WP Mail SMTP as it allows you to easily send WordPress emails using any SMTP service provider.

With that being said, let’s see how you can send automated coupons in WordPress and bring back customers. Simply use the quick links below to jump to the method you want to use.

Method 1. Using FunnelKit (Best for WooCommerce Users)

One way to send automated coupons in WordPress, is by using FunnelKit Automations.

FunnelKit is a WordPress sales funnel builder and optimization plugin that allows you to create powerful customer winback campaigns. It also lets you create unique, personalized coupons, which can really catch the shopper’s attention.

FunnelKit integrates with WooCommerce and has lots of features that are designed to grow your online store. With that in mind, FunnelKit is a great choice if you already use WooCommerce to sell products and services online.

How to Set up the FunnelKit WordPress Plugin

First, you’ll need to install and activate the free version of FunnelKit Automations, as it provides the base for the premium plugin’s features. For more details, please see our guide on how to install a WordPress plugin.

After that, you’ll need to install and activate the FunnelKit Automations Pro plugin.

After activating both plugins, go to FunnelKit Automation » Settings. You can now go ahead and add the license key to the ‘License’ field.

Adding a license to the FunnelKit Automations WordPress plugin

You’ll find this information in your account on the FunnelKit website. After adding this information, click on the ‘Activate’ button.

How to Create an Automated Coupon Workflow for WordPress

Now, we’re going to create a workflow that will generate a personalized coupon and send it to the customer via email. This workflow will run once 30 days have passed since the customer’s last order.

To create the workflow, go to FunnelKit Automations » Automations (Next Gen) in the WordPress dashboard. Then, click on the ‘Add New Automation’ button.

Creating a new WordPress automation with FunnelKit

You’ll now see all the different automation templates that you can use.

Since we want to create our own workflow, select ‘Start from Scratch.’

Creating a custom automated workflow in WordPress

In the popup that appears, type in a name for the automation. This is just for your reference, so you can use anything you want.

With that done, click on ‘Create.’

Add a name to your FunnelKit automation workflow

Now, we need to choose the action that will kickstart the workflow, so click on ‘Select Trigger.’

In the left-hand menu, choose ‘WooCommerce’ and then click to select ‘Customer Win Back.’

Adding a 'customer winback' trigger to an automation workflow

With that done, click on ‘Done’ to add the trigger to your automation workflow.

Back in the main editor, click on the ‘Customer Win Back’ trigger.

Adding a trigger to the FunnelKit automation editor

In the ‘Customer Last Ordered Period’ section, you can type in how long FunnelKit will wait before running the workflow.

For example, in the following image the workflow will run when 30 days have passed since the customer’s last order.

FunnelKit will repeat this automation once every 24 hours, so it’s important to only run it for a short period of time. For this reason, we’ve set the workflow to stop when 35 days have passed since the customer’s last order.

Adding an order period to the automation recipe

In this way, you won’t annoy customers by sending them dozens of emails.

Next, you can set the time when the automation will run, using the ‘Schedule this….’ fields. FunnelKit will use your store’s timezone, so you may want to change your online store settings if you want to use a different timezone instead.

Scheduling an automated coupon code

With that done, click on ‘Save.’

Back in the main workflow editor, click on ‘+’ and then select ‘Action.’

Adding actions to an automated workflow in WordPress

In the popup that appears, select ‘WooCommerce’ and then click on ‘Create Coupon.’

Simply click on ‘Done’ to add this action to the workflow.

How to create an automated coupon using FunnelKit

Back in the main FunnelKit editor, click on the action you just added. This opens a popup where you can customize the ‘Create Coupon’ action.

To start, type a name for the coupon into the ‘Coupon Title’ field. This is just for your reference so you can use anything you want.

Creating a winback customer automation workflow in WordPress

After that, choose the type of coupon that you want to create, using the ‘Discount Type’ dropdown menu.

FunnelKit supports percentage discount, fixed cart discount, and fixed product discount. Most of the time, you’ll want to select ‘Percentage Discount’ to make sure all customers get a similar benefit, no matter how much they spend or what products they buy.

After that, type an amount into the ‘Amount’ field. For example, you might offer customers 20% off, or a $5 discount on all purchases.

How to create an automated percentage discount coupon

FunnelKit automatically creates a unique coupon code for each contact. However, you can add a prefix to the start of the coupon, which can either be plain text or dynamic tags. FunnelKit will replace these tags with real text every time it creates a code, so this is a great way to create personalized coupons.

Since we want to bring shoppers back in, you may decide to include the customer’s name in the coupon. This can catch their attention, and also makes your code easier to remember.

To add plain text as a prefix, simply type into the ‘Coupon Code Prefix’ field.

Adding a prefix to the automated coupon code

To add one or more tags, click on the ‘Merge tags’ icon.

This is the button that has curly braces.

Adding dynamic text to the automated coupon code

Now, you’ll see all the tags that you can use in the automated coupon.

We’re going to use the {{contact_first_name}} tag, but you can use any tags you want.

How to create a personalized coupon code with merge tags

Simply copy each tag and then paste it into the ‘Coupon Code Prefix’ field.

As you can see in the following image, you can use a mix of plain text and tags.

How to create a personalized and dynamic coupon code

By default, the coupon will never expire. A sense of urgency and FOMO can push customers to use a coupon, so you may want to select the radio button next to ‘Expire after Specific Days’ or ‘Expire on Specific Date.’

You can then use the controls to specify when the coupon will expire.

Adding a coupon expiration date to your WordPress coupon

Finally, you can choose whether the coupon gives customers a free shipping discount.

Shoppers love free shipping, so you may want to consider adding this to your coupon by selecting the ‘Yes’ radio button under ‘Allow Free Shipping.’

How to create a free shipping discount for your online store

When you’re happy with how the coupon is set up, make sure you copy the small pieces of code under the ‘Coupon Title.’

You’ll need this coupon code for the email we’ll be creating in the next step, so store it somewhere safe.

Creating an automated coupon to win back customers

With that done, click on ‘Save’ to store your changes.

Now we have a coupon, it’s time to create the email that FunnelKit will send to your customers. To add an email action, click on the ‘+’ button and then select ‘Action.’

Add an email action to win back customers

If it isn’t already selected, then click on ‘Messaging’ in the left-hand menu.

Then, select ‘Send Email’ and click on ‘Done.’

Choosing an action in the FunnelKit automation plugin

You can now create an email by typing in a subject and preview, and adding body text.

Similar to creating a coupon, it’s best to use a mix of plain text and tags. To add dynamic tags, click on the ‘Merge Tags’ icons that appear next to the To, Subject, and Preview Text fields.

How to create a personalized email to win back customers

If you want to add tags to the email body, then you can click on the ‘Merge Tags’ button.

To add your coupon code, simply paste or type in the {{wc_dynamic_coupon id= code we copied in the previous step.

Create a personalized email to bring back customers

When you’re happy with how the email looks, click on ‘Save & Close.’

That’s it. When you’re ready to make the automation live, click on the ‘Inactive’ slider so it turns to ‘Active.’

Making your workflow automation live

Now, FunnelKit will automatically send the coupon to any customer who hasn’t purchased from you in the past 30 days.

Method 2. Using Uncanny Automator (Over 100 Integrations)

Another way to send automated coupons in WordPress, is by using Uncanny Automator. It is one of the best WordPress automation plugins on the market and lets you create powerful workflows to save time and help you respond to customers more quickly.

Uncanny Automator works seamlessly with WooCommerce, plus all of the must have WordPress plugins and third-party tools. If you’re already using lots of different software on your online store, then Uncanny Automator may be a good choice for you.

There is a free Uncanny Automator plugin that lets you automate many common tasks. However, we’ll be using Uncanny Automator pro because it works with WooCommerce.

To start, you’ll need to install Uncanny Automator pro, plus the free plugin as it provides the base for the premium version. If you need help, then please see our guide on how to install a WordPress plugin.

Upon activation, go to Automator » Settings and enter your license key into the ‘Uncanny Automator Pro license key’ field.

Adding an Uncanny Automator license to your WordPress website

You’ll find this information under your account on the Uncanny Automator website.

Uncanny Automator is a powerful and flexible plugin, so there’s lots of different ways that you can bring customers back to your site. Let’s take a look at a few options.

Automatically Send Coupons to Logged-Out Customers

It’s smart to let customers create an account with your online store, as it encourages brand loyalty and makes it easier for shoppers to buy from you in the future.

User registration can also help with lead generation. If you get the shopper’s email address, then you can target them with email marketing, personalized ads, an email newsletter, and much more.

If you’re using WooCommerce, then this plugin automatically creates all the pages customers need to create and manage an account. WooCommerce also adds a new Customer role, which it automatically assigns to any shoppers who register with your store.

Are you using a different eCommerce solution that doesn’t support customer registration? Then see our guide on how to allow user registration on your WordPress site.

After that, you can simply create a new role for your customers. For detailed instructions, please see our beginner’s guide to WordPress user roles and permissions.

If you allow user registration, then you can track when a shopper logs out of their account, as this suggests they’re losing interest in your store. You can then send a coupon to encourage them to log back in.

To create this recipe, simply go to Automator » Add new in the WordPress dashboard.

Uncanny Automator will now ask whether you want to create a recipe for logged-in users, or everyone. Go ahead and select ‘Logged-in users,’ then click on the ‘Confirm’ button.

Creating a logged-in automation recipe with Uncanny Automator

Next, you can give the recipe a name by typing into the ‘Title’ field. This is just for your reference so you can use anything you want.

Once you’ve done that, click on ‘WordPress’ in the ‘Select an integration’ area.

Select WooCommerce as an integration

You can now choose a trigger, which is anything that kickstarts the recipe.

In the dropdown menu, start typing the following ‘A user logs out of a site’ and then select the right option when it appears.

Choosing a trigger for the automated coupon recipe

We only want to run the workflow when someone with the ‘Customer’ user role logs out of their account.

With that in mind, click on the ‘Add filter’ button.

How to create an automation workflow for your WooCommerce customers

In the popup that appears, click on ‘WordPress.’

Next, find ‘The user has a specific role’ in the dropdown menu.

Filtering your users based on WordPress role

Open the ‘Role’ dropdown and select the role you’re using for your customers.

After that, go ahead and click on ‘Save filter.’

Sending an automated coupon to your WooCommerce customers

Now it’s time to specify the action that Uncanny Automator will perform every time this workflow runs.

We’re going to send the customer an email containing a coupon, so go ahead and click on ‘Add action.’

Adding actions to an automated recipe

Since we want to send an email, select ‘Emails’ as the integration.

In the dropdown that appears, click on ‘Send an email.’

Send automated coupons in WordPress to bring back customers

This adds all the fields that you can use to create the email.

To start, we need to make sure the message goes to the right user, by clicking on the asterisk next to the ‘To’ field. Then, select ‘Common’ and ‘User email.’

Getting the customer's email address

You can now create the email by adding a subject line and body text.

Here, you can use a mix of plain text and tokens, which are placeholders that Uncanny Automator replaces with real values automatically. For example, if you want to use the customer’s name, then you can click on the asterix and select ‘Common.’

Simply select the ‘User first name’ token to create the personalized greeting.

Adding a dynamic user name token to the coupon workflow

You’ll also need to create a coupon and add it to the email.

The easiest way is by using the Advanced Coupons plugin, which is the best WordPress coupon code plugin on the market. It lets you create lots of different advanced coupons to get more sales and grow your business.

For a step-by-step guide, please see our post on how to create smart coupons.

After creating a coupon, you can simply add it to the email.

Sending an automated coupon email in WordPress to bring back customers

When you’re happy with how the email looks, click on ‘Save.’

After that, it’s time to set a delay. This is how long Uncanny Automator will wait after the customer logs out, before sending them the coupon.

To add a delay, hover your mouse over the ‘Email’ action. When it appears, click on ‘Delay.’

How to add a delay to an automation workflow

You can then add your delay in the popup that appears.

Once you’ve done that, go ahead and select ‘Set delay.’

Adding a time delay to the automated coupon recipe

When you’re happy with how the recipe is set up, it’s time to make it active.

In the ‘Recipe’ box, click the ‘Draft’ switch so that it shows ‘Live’ instead.

Publishing the automated coupon recipe

That’s it. Now, when a customer logs out of their account, Uncanny Automator will wait for the specified amount of time before sending them a coupon code.

Automatically Send Coupons for a Specific Product

Sometimes a shopper may look at a product multiple times. This suggests they’re interested in the item, but something is stopping them from making a purchase.

In this case, you may want to send them a coupon, which will encourage them to splash out on the product.

To get started, create a new recipe for logged-in users following the same process described above. After that, click on ‘WooCommerce’ in the ‘Select an integration’ area.

Adding WooCommerce as an integration in Uncanny Automator

Next, choose a trigger by typing the following ‘A user views a product.’

When the right trigger appears, give it a click.

Get more sales with an automated coupon recipe

By default, this trigger is set to ‘Any product.’

If you want to link the recipe to a specific product, then open the ‘Product’ dropdown and choose that product from the list.

Choose a WooCommerce product from the dropdown menu

Once you’ve done that, click on the ‘Number of times’ button.

By default, the recipe will run every time a customer looks at a product. You should change this, so the customer has to look at the product multiple times before triggering the recipe. To do this, type a different number into the ‘Number of times’ field.

Triggering a workflow when the customer views a product multiple times

When that’s done, click on ‘Save’ to store your settings.

This recipe should only run when a customer views a product, so click on ‘Add Filter.’ In the popup that appears, click on ‘WordPress’ and then choose ‘The user has a specific role.’

Adding WooCommerce features to an automation recipe

After that, open the ‘Role’ dropdown and select the role you’re using for your customers.

When you’re ready, click on ‘Save filter.’

Configuring the automated coupon rule

Now it’s time to add the action. There are a few different ways to send automated coupons from your WordPress website.

To email a code to your customers using Uncanny Automator and Advanced Coupons, simply follow the same process described above.

Another option is to generate the code using WooCommerce. To do this, click on ‘Add Action’ and then select ‘WooCommerce’ as the integration.

Selecting the WooCommerce eCommerce plugin as an integration

In the search bar, start typing ‘Generate and email a coupon code to the user.’

When the right option appears, give it a click.

Generating a WooCommerce coupon

This will add some new settings where you can create the coupon code.

To generate a code automatically, simply leave the ‘Coupon code’ field blank.

How to create a coupon for your WooCommerce online store

In the ‘Discount type’ field, choose the kind of coupon that you want to create, such as a fixed cart discount or percentage discount.

For this guide, we’ll select ‘Percentage discount’.

How to create a percentage discount code

After that, type the percentage discount into the ‘Coupon amount’ field.

In the following image, we’re offering customers a 30% discount on their purchase.

Creating a percentage coupon code

In the next field, you can set an expiry date for the coupon, either by using the YYY-MM-DD format or typing in the number of days until the coupon expires.

For example, in the following image the coupon will expire after 7 days.

Adding an expiration date to an automated coupon code

You can also set a minimum and maximum spend for the coupon. We’ll leave these fields blank so the customer can use the code with any purchase.

You may also want to check the ‘For individual use only’ box so customers can’t use this code in combination with other coupons.

Creating a coupon for individual use

Next, scroll to the ‘Usage limit per coupon’ section. The shopper should only be able to use the coupon once, so type in ‘1.’

There are lots of other settings you can change for the coupon. It’s a good idea to look through these settings to see whether you want to make any more changes.

When you’re happy with how the coupon is set up, scroll to the ‘Email’ section. To start, find the ‘To’ field and then click on the asterisk next to it. Then, click on ‘Common’ and select ‘User email.’

Creating an automated coupon email to bring back shoppers

With that done, you can add a subject line and change the text in the email body.

To create a more personalized email, it’s a good idea to use a mix of plain text and tokens, by following the same process described above.

Adding a coupon to your WooCommerce email

When you’re happy with the email, click on the ‘Save’ button to store the recipe.

After that, you can make the recipe live by clicking the ‘Draft’ switch so that it shows ‘Live.’

Making an Uncanny Automator recipe live on your WordPress website

Now, every time someone views a product multiple times, it’ll trigger the recipe workflow.

We hope this article helped you learn how to send automated coupons in WordPress to bring back customers. You may also want to check out our guide on how to create a WooCommerce popup to increase sales and the best WooCommerce plugins for your store.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Send Automated Coupons in WordPress to Bring Back Customers first appeared on WPBeginner.

How to Send Email in WordPress using the Gmail SMTP Server

Are you having trouble sending emails from your WordPress site? One easy way to solve this is by sending WordPress emails using the Gmail SMTP server. In this article, we will show you how to send emails from your WordPress site using the Gmail SMTP server.

Send WordPress emails using Gmail SMTP server

Why and When You Need Gmail SMTP Server for WordPress Emails

Your WordPress site sends emails to notify you of new user registration, lost password reset, automatic updates, and even notifications from your contact forms.

By default, WordPress uses the PHP mail function to send out email notifications. However, this function does not work as expected due to a number of reasons.

Most WordPress hosting companies restrict usage of this function to prevent abuse and spam.

Spam filters on popular email service providers check incoming emails to monitor if they are sent from authentic mail servers. Default WordPress emails fail this check and sometimes may not even make it to the spam folder.

SMTP (Simple Mail Transfer Protocol) is the industry standard for sending emails. Unlike PHP mail function, SMTP uses proper authentication which increases email deliverability.

Gmail provides SMTP service that you can use to send out emails from your WordPress site. If you just want to send WordPress notification emails to yourself and few users on your site, then Gmail SMTP servers are the best option.

However, if you are planning on sending newsletter emails using WordPress, then you should use a mass emailing service provider, like MailGun or SendGrid.

Free vs Paid Gmail SMTP Service for WordPress

You can use your free Gmail account to send out WordPress emails. However, for better deliverability, we recommend using paid Google Apps for Work with Gmail.

With Google Apps for Work, you get your own professional branded email address such as ([email protected]).

Google Apps require you to add MX records to your domain name which means that your emails will appear to be coming from your own domain name boosting authenticity and ensuring better deliverability.

We use Google Apps for Work for WPBeginner and can honestly say it’s the best.

How to Send WordPress Emails Using Gmail SMTP Server

If you decided to use Google Apps for Work, then you first need to set up your domain to work with Google Apps. We have a step by step tutorial on how to setup a professional email address with Google Apps and Gmail.

Rest of the instructions are the same whether you are using paid or free Gmail account.

First thing you need to do is install and activate the WP Mail SMTP plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to visit Settings » WP Mail SMTP page to configure the plugin settings.

WP Mail SMTP Settings

First you need to make sure that you use your Gmail email address in the ‘From Email’ field. Next, you need to provide the sender name.

WP Mail SMTP plugin offers two ways to connect your WordPress site to the Gmail servers.

The first method uses OAuth Authentication. This is a more secure method to send emails using Gmail servers.

The second method is by entering Gmail SMTP settings manually. This method is not recommended because it is less secure.

That being said, let’s set up WordPress to use Gmail SMTP for sending emails.

Method 1: Setting up Gmail to Send WordPress Emails using OAuth Protocol

This method is recommended for all users. It is more secure and once you set it up, you’ll never have to do that again.

You need to start by selecting Gmail as your mailer and set the return path to be the same as sender.

Select Gmail and set return path

Next, you will see the option to enter your Client ID, Client Secret, and a URL in ‘Authorized redirect URI’ field.

Let’s set up these fields.

Creating an App and Generate API Keys for Gmail

Visit the Google Developers Console website and create a new project.

Create a new Google Developer Console project

If you don’t see the blue button to create a project, then you can also click on select a project drop down and create a new project.

You’ll be asked to provide a name for your project. Give it a memorable name, so that you can easily recognize it in the future.

Name your project

After that, click on the create button to continue.

Developer console will now create your project and take you to its dashboard. Google offer developers access to many of their APIs and services. You need to enable the APIs that you will be needing for this project.

Enable APIs

Click on Enable APIs and services button to continue.

This will bring you to the APIs library page. Next, you need to type Gmail in the search box to quickly find the Gmail API and click to select it.

Select Gmail API

You will now see an overview of the API and what it can do. Simply click on the ‘Enable’ button to continue.

Enale Gmail API

Now that your API is enabled, the next step is to create credentials that you can use in your WP Mail SMTP plugin settings.

Click on the create credentials button to continue.

Create credentials

On the next screen, you will need to select ‘Web browser JavaScript’ in ‘Where you’ll be calling the API from’ field. After that click on the ‘User Data’ option.

API credentials step 1

To continue, click on the ‘What credentials do I need?’ button.

You will now be asked to provide a name for your OAuth client name. You can enter ‘WP Mail SMTP’ here.

API Credentials step 2

Under JavaScript origins field, you need to add your website’s domain name. Next, you need to copy and paste the authorized redirect URL from WP Mail SMTP plugin settings.

After that click on the ‘Create client ID’ button to continue.

Next, you need to enter a name for OAuth consent screen. You can put the plugin’s name here.

Ouath consent screen

After entering the details, click on the continue button and the developer console will show your client ID. You can copy and paste this in the WP Mail SMTP plugin’s settings page. However, you will still need to add your client secret key.

Getting your client ID

Go ahead and click on the Done button to move on.

You will now be taken to your project’s credentials page. You will see your recently created credentials listed there. You need to click on the edit icon next to your credentials to continue.

Edit credentials

This will bring you to the edit credentials page where you will be able to see your client secret key. You need to copy and paste the key in your plugin’s settings page.

Client secret key

Return back to plugin’s settings page in your WordPress admin area. Now that you have both client ID and client secret keys, you need to click on the save settings button to continue.

Save client credentials in plugin settings

The plugin will now store your settings and reload the page. After that you need to scroll down to the bottom of the settings page and click on the ‘Allow plugin to send emails using your Google account’ button.

Allow plugin to send emails

This will take you to your account on Google, and you will be asked to give the website permission to send emails on your behalf.

Allow Gmail

Click on Allow button to give permissions.

After that, you will be redirected back to your website where you will see a success message.

Connected successfully

Method 2: Setting up Gmail SMTP as SMTP Sender

This method allows you to manually connect to Gmail’s SMTP servers to send your WordPress emails.

First, you need to visit Settings » WP Mail SMTP page to configure the plugin settings.

You need to start by providing the Gmail address you want to use in the From email field, and your name in the name field.

Gmail SMTP

Next, you need to select ‘Other SMTP’ as your mailer and check the box next to return path.

After that, scroll down to the Other SMTP section to configure more settings.

Gmail SMTP settings for WP Mail SMTP plugin

Here is the exact configuration you need to add in the plugin settings:

  • SMTP Host: smtp.gmail.com
  • SMTP Port: 465
  • Encryption: Use SSL encryption
  • Authentication: Turn on authentication
  • Username: Your complete Gmail address, e.g. [email protected] or [email protected]
  • Password: Password of your Gmail account

Once you are done, click on the save changes button to store your settings.

That’s all, you have successfully setup WP Mail SMTP to use Gmail SMTP servers.

Testing Your WP Mail SMTP Settings

WP Mail SMTP plugin allows you to test your email settings, so you can make sure that everything is working properly.

You need to visit Settings » WP Mail SMTP page and click on the ‘Email Test’ tab. Simply provide an email address that you can access in the send to field and click on the send email button.

Send test email

You will see a success message. You can now check your inbox to see a message with the subject line ‘WP Mail SMTP: Test Email to…’.

That’s all, you have successfully setup your WordPress site to send emails using Gmail SMTP servers.

Troubleshooting Gmail SMTP Not Working Issues

We have seen users encounter few issues when using Gmail SMTP with certain shared hosting configurations.

Take the following steps to fix the Gmail SMTP issue:

  1. Login to your cPanel account and create an email account that matches your Google apps email address. This might seem strange because you’re not using your server for emails. This step basically tricks your server into believing that you’re sending the email through the server.
  2. In your cPanel account, go to the MX Records and change the MX routing from automatic to remote. It might be a little tricky to find since each host now has custom cPanel interface. You need to look for a small link next to MX that says Email Routing: Remote Mail Exchanger.
  3. After that log back into your WordPress site and send a test email.

We hope this article helped you learn how to send email in WordPress using the Gmail SMTP server. You may also want to see our list of the 5 best contact form plugins for WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Send Email in WordPress using the Gmail SMTP Server appeared first on WPBeginner.