Collective #745



Collective 745 item image
Our Sponsor

SynapseIndia

Transformational solutions and digital growth, enhance your shopify/e-commerce store and mobile app.

Learn more



Collective 745 item image

Microfeed

A lightweight CMS for blogs, podcasts, documents and more. Self-hosted on Cloudflare.

Check it out



Collective 745 item image

Koi Pond

Scott Darby made this wonderful interactive koi pond demo with a heightfield water simulation, real-time refractions and a generative night sky that’s different each time.

Check it out


Collective 745 item image

OpenAI PHP

Nuno Maduro made OpenAI PHP for Laravel which is a supercharged community PHP API client that allows you to interact with the Open AI API.

Check it out



Collective 745 item image

Framer Awards 2022

The Framer team is inviting you to design and publish your most creative site and join the #FramerAwards2022. The Framer team will review all submissions and announce winners in the end of January.

Check it out



Collective 745 item image

A CSS challenge: Skewed Highlight

Sacha Greif recently issued a challenge on Twitter, daring his followers to create a visually striking highlighter effect using only CSS. Vadim Makeev accepted the challenge and set to work on coding a solution.

Check it out



Collective 745 item image

CSS Subgrid

Get ahead of the game and learn about the potential of subgrid in web design with Rachel Andrew’s informative article on the subject.

Read it


Collective 745 item image

2022 Roundup of Web Research

Geoff Graham from CSS-Tricks has compiled the annual roundup of the latest front-end research, showcasing this year’s trends and offering insights into what we can expect in the coming year.

Read it


Collective 745 item image

Localfonts

This handy tool allows you to preview and compare your local fonts against various background colors, making it easy to select the most fitting font for your newxt project.

Check it out



Collective 745 item image

Pbproxy

If you need to access and manipulate the clipboard on a remote machine, this tool makes it easy to do so.

Check it out


Collective 745 item image

Obscure CSS: Restoring Visibility

In this article, Roman Komarov talks about one of the interesting aspects of the visibility propery in CSS and proposes a bold idea: what if we would never use visibility: visible?

Read it


Collective 745 item image

Parsify Desktop

In case you didn’t know about it: Parsify Desktop is a next generation, notepad-based calculator, built with extendibility and privacy in mind.

Check it out



Collective 745 item image
Our Sponsor

Where is my website traffic and how do I get more?

Some straight facts about search engine traffic: 51% of all website traffic is driven by SEO, 40% of all online revenue is driven by SEO, 72% of search traffic goes to the first 10 results on the first page. We have the formula to get your website the conversions you are looking for! Book your complimentary SEO call.

Book now

Help with getting the Alert to Submit the Form

I've added a SweetAlert into an existing upload Form, where upon selecting the Submit button it successfully displayed the pop-up alert. Like so:

$('#submit-btn').on('click',function(e){
e.preventDefault();
var form = $('.pt_upld_page_frm');
swal.fire({
title: "Are you sure?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, submit it!",
closeOnConfirm: false
}).then((result) => {
if (result.isConfirmed) { $('.pt_upld_page_frm').submit(); }

});
});

But, my goal is to have the "Yes, submit it" to actually submit the chosen uploaded file. But it didn't upload it.
So, I added code from farther down the file, into the alert, like so:

$('#submit-btn').on('click',function(e){
e.preventDefault();
var form = $('.pt_upld_page_frm');
swal.fire({
title: "Are you sure?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, submit it!",
closeOnConfirm: false
}).then((result) => {
if (result.isConfirmed) {
$('.pt_upld_page_frm').ajaxForm({
   //$('#upload-form form').ajaxForm({
      url: '{{LINK aj/ffmpeg-submit}}?hash=' + $('.main_session').val(),
    beforeSend: function() {
       $('#submit-btn').attr('disabled', true);
       $('#submit-btn').val("{{LANG please_wait}}");
},
 success: function(data) {
         if (data.status == 200) {
window.location.href = '{{LINK home}}';
         }
         else if(data.status == 402){
            swal({
               title: '{{LANG error}}',
               text: data.message,
               type: 'error',
               confirmButtonColor: '#3085d6',
               cancelButtonColor: '#d33',
               confirmButtonText: 'OK',
               buttonsStyling: true,
               confirmButtonClass: 'btn btn-success',
            }).then(function(){
               window.location.href = '{{LINK upload-video}}';
            },
            function() {
               window.location.href = '{{LINK }}';
            });
         }
         else {
            $('#submit-btn').attr('disabled', false);
             $('#submit-btn').val('{{LANG publish}}');
            Snackbar.show({text: '<div>'+ data.message +'</div>'});
         }
      }
   });
//});
});
}
});
});

But now it submits successfully, but doesn't display the Alert first. The goal is to have the "Yes, submit it" to actually submit
Any guidance is welcomed.

How To Add Three Photo Filters to Your Applications in Java

A unique image aesthetic makes a big difference in representing any personal or professional brand online. Career and hobby photographers, marketing executives, and casual social media patrons alike are in constant pursuit of easily distinguishable visual content, and this basic need to stand out from a crowd has, in turn, driven the democratization of photo editing and filtering services in the last decade or so. Nearly every social media platform you can think of (not to mention many e-commerce websites and various other casual sites where images are frequently uploaded) now incorporates some means for programmatically altering vanilla image files. These built-in services can vary greatly in complexity, ranging from simple brightness controls to gaussian blurs.

With this newfound ease of access to photo filtering, classic image filtering techniques have experienced a widespread resurgence in popularity. For example, the timeless look associated with black and white images can now be hastily applied to any image upload on the fly. Through simple manipulations of brightness and contrast, the illusion of embossment can be harnessed, allowing us to effortlessly emulate a vaunted, centuries-old printing technique. Even posterization – a classic, bold aesthetic once humbly associated with the natural color limitations of early printing machines – can be instantly generated within any grid of pixels.  

Mastodon Verification of CodePen Profiles

TL;DR — If you link to your Mastodon profile from CodePen, and your CodePen profile from Mastodon, your Mastodon profile will display your CodePen profile as a verified link, proving ownership.

How does that work? It’s just HTML!

There is a rel attribute that can go on anchor (<a>) links. The values for rel have a variety of functionality. For example, you can tell search engines not to follow or rank a link and that it is user-generated:

<a 
  href="https://user-generated.com" 
  rel="nofollow ugc">
    User Link
</a>

There are safety and performance-gaining possibilities for using values like noreferrer and noopener as well.

Here’s another value: rel="me" (you can space-separate multiple values). The me value is a rather old-school Microformats thing. It’s pretty neat! The purpose is that you put it on links that point to other things that you own or control. Then, if the link you’re pointing to points directly back also with a rel="me" link that is a verification-of-ownership situation. As the wiki puts it:

Thus establishing a bi-directional rel-me link and confirming that the two URLs represent the same person.

The federated social networking site Mastodon (here’s me!) uses this exact setup to verify personal links. Here’s an image of my Mastodon profile:

Notice there are three links, the first two of which are highlighted with checkmarks and green:

Those “verified” links are verified because they follow the bi-directional rel="me" linking exactly as Mastodon requires.

On CodePen, we’re now adding that me value to all the links you add to your profile. Mastodon does the same, and thus verification is achieved. On my third link, that link to Amazon.com (obviously) doesn’t contain a link back to my Mastodon profile, so it doesn’t verify.

The Other Possible HTML to Verify

While CodePen is now properly putting the me value on profile URLs — that actually didn’t work for Mastodon verification on our first attempt. There were actually two problems:

  • CodePen profiles are client-side rendered, and the Mastodon crawler can only see server-side rendered HTML.
  • We needed to ensure the Mastodon crawler didn’t get trapped by the firewall.

With that second one taken care of via DevOps magic, we still needed a way to make sure the server-rendered HTML had something to verify against.

We aren’t yet server-rendering most of our React-rendered pages (we’ll get there), so the HTML that comes across that first request (and what Mastodon crawls) is essentially a shell page with minimal HTML. We could have tossed the <a rel="me" ...> links into the <body> of that first response, but that seems a little awkward to only have them ripped away by client-side rendering immediately. Instead, there is another equally valid way to provide rel="me" links, and that’s like this:

<head>
  <link rel="me" href="https://chriscoyier.net/">
  <link rel="me" href="https://front-end.social/@chriscoyier">

So we’re actually doing both the <head> links and the <a> links now, and good news, it works great.


Thanks to Will Boyd for asking about this and Amelia Bellamy-Royds for all the back-and-forth on Mastodon as we figured all this out.


Related writings:

The post Mastodon Verification of CodePen Profiles appeared first on CodePen Blog.

Math Behind Software and Queueing Theory

In this part of the Math Behind Software series, I will be taking a closer look at a branch of mathematics known as queueing theory and its potential applications in the world of software engineering. I will describe some basics around the queueing theory, explain the basic laws from said theory and show you the equations which can be used to estimate queue throughput. I will end with a short example of calculating service capacity with all the things explained earlier. Let’s start with a quick recap of what was described in the previous part, which can be found here.

Contention and Coherency — Recap

In the previous part of the series, I explained contention and coherency delay and their impact on the performance of our system. I brought up concepts like Amdahl’s Law, which is focused on measuring the impact of contention and Universal Scalability Law (Gunther’s Law) which additionally accounts for coherency delay. I described them and presented their equations. I also plotted graphs to show the difference in numbers between both Laws.

How To Use CSS Contain Property To Optimize Browsers

The integral part of web development is cascading style sheets, which are popularly called CSS. The library contains a long list of functions and properties that help us develop functionalities in a couple of lines rather than writing messy JS code. This may include position sticky, media queries, or setting up the aspect ratio for the web page.

In my web dev experience, I always divided the functions and properties available in CSS into two partitions. One section contains easy out specific design-related items in web development, such as sticking an element to the top while the user scrolls. The other section contains better efficiency, optimization, and improvement of the development strategies according to the latest web development trends.

Digital Signature Implementation Using Angular 2 Signaturepad

Create A New Angular Project

Use the Angular CLI tool to create an Angular project. Execute the following command to create the project.

  • ng new signaturePadProject
  • Would you like to add Angular routing? Yes
  • Which stylesheet format would you like to use? CSS

What Is a SignaturePad?

SignaturePad is used to sign a document digitally using a stylus or mouse cursor pointer. At the end of the document, there will be a box that allows the user to sign the document on a web application. After saving the document, the signature gets stored in a base64-type image.

Cloud Computing Trends for 2023

As we move into 2023 and beyond, every organization will eventually adopt cloud models. Existing cloud businesses will look at ways to streamline their processes for rapid growth and better business continuity.

Here are my views on top cloud computing trends that organizations need to watch out for.

Top 5 Cucumber Best Practices for Selenium Automation

Do you know Cucumber is a great tool used to run acceptance tests using the plain-text functional descriptions with Gherkin? Behavior Driven Development strategy or BDD, as it is popularly known, is implemented using the Cucumber tool.

The best part about using the Cucumber BDD framework are:

Binary Code Verification in Open Source World

The IT industry has faced new security challenges with the growing popularity of Open Source Software (OSS). Although the challenges were always there, the number of applications based on OSS has highlighted the problem. Furthermore, as OSS stands out as the basis for many of the systems in the cloud, this increases the pressure because a bug in OSS exposes the whole ecosystem to risk.

OSS, as an approach, was designed for free use, encouraging the developers' community to implement and build new applications and software based on it, as well as contributing to the code. This idea proved itself as the best functional approach in creating the code, improving it, and finding and fixing the bugs. However, at the current level of OSS implementation, the safety point seems to be lagging behind it. 

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.