How to Send a Coupon After a Customer’s First WooCommerce Order
WooCommerce has no native trigger for a customer’s first order, so you need a workflow plugin to detect it and send the coupon automatically. The setup takes under 15 minutes and works without writing any code.
This tutorial covers the complete workflow: detecting whether an order is genuinely a first purchase, generating a coupon, sending it by email, and preventing it from being shared or used by someone else. We also cover a lightweight developer hook at the end for shops that want zero extra plugins.
Before we get into the steps, two decisions shape everything else: when to send (immediately or delayed) and unique versus generic codes. A generic code like WELCOME10 is easy to share and leaks across forums within days. A unique, single-use code tied to the customer’s email is worth the extra setup time.
Does WooCommerce Handle This Natively?
No. The WooCommerce core documentation covers coupons and email templates, but there is no built-in condition for “this customer has zero previous orders.” Every approach requires either a plugin or custom code.
The core “Order Completed” email does let you attach a static coupon code as text, but it fires on every order, not just the first. That means a customer on their tenth purchase would still receive a first-order coupon if you configure it that way.
A generic coupon code shared in a Facebook group costs you full margin on every order it touches. A unique single-use code costs you margin once, on the customer it was meant for.
What You Need Before You Start
- WooCommerce installed and running with at least one completed order to test against
- A workflow plugin that supports a first-order condition (covered below)
- A coupon action that can create a unique code per customer, not just insert a static string
- An email action that can embed that generated coupon code into the message body using merge tags
- A test customer account with zero previous orders, so you can verify the condition fires correctly
The WooCommerce coupon documentation explains usage restrictions you can set at the coupon level, including email restriction. We will use that in Step 4.
Step-by-Step: Build the Workflow
Step 1. Install and activate the plugin
Install Krom Automation from the WordPress.org plugin directory through Plugins Add New. Activate it.
You will see a new Krom Automation menu item in your WordPress admin. No licence key is needed for the free version.
Once active, go to Krom Automation Workflows and click New Workflow. You will land on the visual canvas. If this is your first workflow, the step-by-step workflow guide in the documentation covers canvas navigation in detail.
Step 2. Set the trigger to Order Completed
Click the trigger node on the canvas and choose Order Completed from the WooCommerce section. This fires every time an order moves to the Completed status, which is what you want as the entry point. You can see a full list of available triggers in the free triggers reference.
At this stage the workflow fires on every completed order. The next step narrows it to first-time customers only.
Step 3. Add a condition to check order count
Add a Condition node after the trigger. Set it to check whether the customer’s total order count equals 1.
The Yes path continues to the coupon creation. The No path does nothing (leave it empty or connect it to a Stop node).
This is the critical gate. Without it, every customer who completes any order receives the coupon. The conditions and branching documentation shows the exact fields and operators available for this check.
One important note: “Order Completed” fires after payment, not at checkout submission. That means the order count at the moment the trigger fires will already include the current order. So “equals 1” correctly identifies a customer whose very first order just completed.
Step 4. Create the coupon
On the Yes path, add a Create Coupon action. Configure it as follows:
- Discount type: Percentage or fixed, your choice. We use 15% as a worked example.
- Coupon code: Use a merge tag to generate a unique code per customer, for example
WELCOME-{{order.id}}or a random string pattern. The merge tags documentation lists every available variable. - Usage limit: Set to 1. This ensures the code can only be redeemed once, by anyone.
- Allowed emails: Add
{{customer.email}}as a merge tag. WooCommerce will reject the coupon if the email at checkout does not match, which prevents sharing. - Expiry date: Set to 30 days from now. A deadline increases redemption rates. Without one, customers save the code and forget it.
- Minimum spend: Optional. Setting a floor (say $30) protects margin on small repeat orders.
Step 5. Add a delay (optional but recommended)
Send the coupon immediately and it arrives inside the order confirmation email window, where it competes for attention. A delay of 2 to 3 days lets the product arrive first, so the coupon lands when the customer is thinking about their next purchase rather than waiting for the current one.
Add a Delay node between the Create Coupon action and the Send Email action. Set it to 2 days. The delays and scheduling documentation covers all available units including hours, days and weeks.
Step 6. Send the email
Add a Send Email action. Use merge tags to personalise the subject and body:
- To:
{{customer.email}} - Subject:
Your exclusive discount, {{customer.first_name}} - Body: Write a short message and embed
{{coupon.code}}to display the unique code the previous action generated
Keep the email to three short paragraphs. State the discount amount, the expiry date, and the minimum spend if you set one. Ambiguity here costs you redemptions.
Step 7. Test before activating
Use the workflow simulator to run a dry test with no side effects before you go live. The simulator documentation explains how to pass in a sample order and inspect what each node would do. Check that the condition resolves to Yes for a customer with one order and No for a customer with two or more.
When the test passes, enable the workflow and place a real test order using a fresh customer account. Confirm the coupon appears in WooCommerce Coupons with the correct email restriction, and that the email arrives on schedule.
Running the simulator before activating takes two minutes. Discovering the condition was inverted after 400 real orders have fired takes considerably longer to unpick.
What the Condition Check Actually Prevents
The order-count condition does one thing that email restriction alone does not: it stops the workflow from firing at all for repeat customers. Email restriction at the coupon level stops redemption, but the email still sends, which looks like a mistake to the customer. Catching it in the workflow condition means no email, no coupon, no confusion.
Three scenarios worth testing explicitly:
- Guest checkout, then account creation: The order count is attached to the email address. If the customer checks out as a guest and then creates an account with the same email, WooCommerce links the history. The condition will count the guest order.
- Refunded first order: A refund does not remove the order from the count. If this matters for your store, add a second condition checking order status is not Refunded.
- Multiple orders on the same day: On very high-volume flash sales, two orders can complete within seconds. The run-once-per-entity setting prevents the workflow from firing twice for the same customer. Enable it in workflow settings.
Timing: When Should the Coupon Email Arrive?
| Send timing | Best for | Risk |
|---|---|---|
| Immediately after order | Digital products, instant delivery | Lost in the confirmation email batch |
| 2 to 3 days after order | Physical goods with standard shipping | Requires a delay node and reliable WP-Cron |
| After order status changes to Delivered | Shops using shipping tracking plugins | Requires a Pro trigger tied to status change |
The 2 to 3 day delay is the most common setup we see for physical goods. The customer has the product in hand, the purchase satisfaction is fresh, and the coupon arrives before competing stores have a chance to retarget them. For digital products, immediate delivery makes more sense because there is no shipping window to work with.
One caveat on delays: delays run through WordPress Cron. On low-traffic sites that go hours between visits, WP-Cron fires late.
If your store gets fewer than a few hundred visits a day, configure a real server cron job to call wp-cron.php on a schedule. The WordPress developer documentation on WP-Cron covers this setup.
Cost Comparison: Which Approach Fits Your Setup
| Approach | Upfront cost | Year 1 cost | Unique codes | Visual builder |
|---|---|---|---|---|
| Krom Automation free | $0 | $0 | Yes, via merge tags | Yes |
| Krom Automation Pro (1 site) | $69/year | $69 | Yes | Yes, with email builder |
| AutomateWoo | Included with WooCommerce paid plans | Varies by plan | Yes | No, list-based rules |
| Custom code (developer) | Developer time (est. 1 to 3 hours) | Maintenance burden | Requires extra code | No |
The free tier covers everything in this tutorial. Pro adds the visual email builder for designing the coupon email without touching HTML, plus a Schedule trigger and an incoming webhook receiver if you want to extend the workflow further.
The Developer Shortcut: No Plugin Required
If you manage your own site and want zero additional plugins, this hook handles the detection. Add it to your theme’s functions.php or a site-specific plugin:
add_action( 'woocommerce_order_status_completed', function( $order_id ) {
$order = wc_get_order( $order_id );
$customer = new WC_Customer( $order->get_customer_id() );
if ( $customer->get_order_count() !== 1 ) {
return;
}
// Create coupon
$coupon_code = 'WELCOME-' . strtoupper( wp_generate_password( 8, false ) );
$coupon = new WC_Coupon();
$coupon->set_code( $coupon_code );
$coupon->set_discount_type( 'percent' );
$coupon->set_amount( 15 );
$coupon->set_usage_limit( 1 );
$coupon->set_email_restrictions( [ $order->get_billing_email() ] );
$coupon->set_date_expires( strtotime( '+30 days' ) );
$coupon->save();
// Send email
WC()->mailer()->emails['WC_Email_Customer_Processing_Order']
->trigger( $order_id ); // Replace with a custom email class for production
} );
This is a starting point, not production-ready code. The email line needs replacing with a custom WC_Email class that includes the coupon code in the body.
If that scope is comfortable for your team, this route avoids a plugin entirely. If it is not, the visual workflow approach is faster and easier to maintain.
What None of the Tutorials Tell You
Most guides stop at “configure the plugin and send the email.” Three things that actually affect whether the coupon converts into a second purchase:
- Subject line specificity wins. “Here’s your discount” gets ignored. “Your 15% off expires in 30 days, [Name]” tells the customer exactly what they have and when it expires. That specificity drives opens.
- The minimum spend floor matters more than the discount percentage. A 10% coupon with a $50 minimum on a store whose average order value is $45 will almost never redeem. The floor needs to sit below the average order value or you are optimising for a transaction that rarely happens.
- Coupon visibility on the thank-you page doubles as a channel. Email is not the only delivery point. Adding the coupon code to the WooCommerce thank-you page via a custom hook means customers see it immediately, before email even arrives. The delay approach and the thank-you page approach are not mutually exclusive.
The minimum spend floor is the detail most store owners skip. Set it above your average order value and the coupon looks generous but almost never redeems.
Other Tools Worth Knowing About
If you are running a WooCommerce store alongside other automation needs, two other wpRigel tools are worth a look. Commandify is a command palette for the WordPress admin.
Press Cmd or Ctrl plus K to search orders, customers and products without clicking through menus. It is the only command palette with real WooCommerce order and customer management built in, which makes post-purchase admin significantly faster.
Pollify builds polls, surveys and quizzes as native Gutenberg blocks. If you want to collect feedback from customers after their first purchase, a post-order survey embedded on the thank-you page or in the follow-up email is a natural companion to the coupon workflow.
If your store runs WooCommerce Subscriptions alongside standard orders, the WooCommerce Subscriptions integration documentation shows how subscription-specific triggers work alongside the standard Order Completed trigger covered here.
Frequently Asked Questions
Does the Order Completed trigger fire for guest checkouts?
Yes. The trigger fires regardless of whether the customer has an account. The order count check uses the billing email to look up history, so guest orders are included in the count as long as the same email address was used.
How do I make sure the coupon can only be used by the original customer?
Set the Allowed Emails field in the Create Coupon action to the customer’s email address using the {{customer.email}} merge tag. WooCommerce will block any checkout that uses a different email address. Combined with a usage limit of 1, the code is effectively single-use and non-transferable.
What happens if the customer’s first order gets refunded?
The order remains in the count even after a refund, so the workflow fires as expected. If you want to withhold the coupon for refunded first orders, add a second condition checking that the order status is not Refunded before the Create Coupon action runs.
Can I send the coupon on the thank-you page instead of by email?
The workflow approach described here sends by email. Displaying the coupon on the thank-you page requires a custom hook using woocommerce_thankyou or a page builder that supports order data. You can run both in parallel: create the coupon in the workflow, display it immediately on the thank-you page via a hook, and then send the email reminder 2 days later.
Will this work if I use a custom order status instead of Completed?
The Order Completed trigger fires specifically on the WooCommerce “Completed” status. If your store uses a custom status as the final step, use the Post Status Changed trigger instead and filter to your custom status. The order count condition logic stays the same.
Next Steps
The workflow in this tutorial takes under 15 minutes to build, but the decisions around discount amount, timing and minimum spend have a bigger effect on your second-purchase rate than the technical setup does. Start with a 15% discount, a 30-day expiry and a minimum spend set $5 below your average order value.
Run it for 60 days, check how many coupons were created versus redeemed in the execution logs, and adjust from there. For more automation ideas once this workflow is live, the article on changing a user role after a WooCommerce purchase shows how to combine the same trigger with a different action to unlock member pricing automatically.