AW Customer Generate Coupon Restricted
Adds a custom AutomateWoo variable for email-restricted coupon generation.
by Raif Deari · github.com/raifd/aw-customer-generate-coupon-restricted
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/raifd/aw-customer-generate-coupon-restricted/archive/refs/heads/main.zipAdds a new AutomateWoo variable that generates a unique coupon, optionally restricted to the customer’s email address. Built for WooCommerce merchants who want more control over coupon usage in automated workflows.
🚀 Features
- New variable:
{{ customer.generate_coupon_restricted }} - Works just like
customer.generate_coupon, but with a checkbox to restrict usage - Email restriction enforced via WooCommerce coupon settings
- Fully compatible with coupon templates and parameters
🛠 Usage
-
Activate the plugin in WordPress.
-
Create or edit an AutomateWoo workflow that uses a
customerobject (e.g. “Review Posted” or “Order Created”). -
Add a “Send Email” or “Add Note” action.
-
Use this variable:
{{ customer.generate_coupon_restricted template: 'your-template' use_email_restriction: 'yes' }} -
Or insert it from the variable picker and enable the checkbox for email restriction.
🧩 Example Workflow
Trigger: Customer leaves a product review
Action: Send a thank-you email with a discount code limited to their email address
🔧 Installation
- Upload the plugin folder to
/wp-content/plugins/ - Activate it via the WordPress admin
- The variable will automatically be available in AutomateWoo workflows under the
customersection
💡 Why This Exists
AutomateWoo’s default coupon variable doesn't include built-in support for email restriction. This plugin extends that functionality for a common use case: personalized, one-time-use coupons.
🧠 Credits
Developed by Raif Deari
Built with the help of ChatGPT for prototyping, debugging, and WooCommerce integration guidance.
📄 License
This plugin is licensed under the GNU General Public License v2.0 or later.