This reference is for developers configuring AutomateWoo email content. It covers the customer.generate_coupon variable, its template-coupon prerequisite, and the checks to complete before enabling a replacement workflow.
Note:
This is a Developer level doc. If you are unfamiliar working with code and resolving potential conflicts, we recommend you work with a Woo Agency Partner for larger projects, or find a WooCommerce developer on Codeable for smaller customizations. We are unable to provide support for customizations under our Support Policy.
Prerequisites
↑ Back to top- Create or confirm a coupon to use as the template, and note its exact coupon code.
- Keep the replacement workflow disabled until you have completed the verification steps below.
Use the generated-coupon variable
↑ Back to topAdd the variable to the AutomateWoo Send Email action:
{{ customer.generate_coupon | template:'welcome' }}
Replace welcome with the exact code of the coupon template you want to use. The template supplies the discount, usage limits, eligible products, and expiry settings for the generated coupon.
Expected result
↑ Back to topWhen the workflow runs in a customer context, AutomateWoo generates a unique coupon from the template and inserts the generated coupon into the email content.
Verify the workflow before enabling it
↑ Back to top- Review the template coupon’s discount, usage, product, and expiry settings.
- Add the variable to the AutomateWoo email content and replace
welcomewith the template coupon code. - Preview the email with test data and confirm that the recipient, message, and coupon details are correct.
- Run a test event while the workflow is disabled, then check the AutomateWoo queue or logs and the received email.
- Enable the workflow only after confirming that the coupon is generated as expected and that the corresponding Follow-Up Emails workflow is disabled.
Troubleshoot missing or invalid coupons
↑ Back to top- Confirm that the template coupon code matches the value after
template:. - Confirm that the email is being generated in a customer context that can resolve the variable.
- Review the template coupon’s discount, usage, product, and expiry settings before testing again.
Risk and recovery
↑ Back to topDo not enable the replacement while the original Follow-Up Emails workflow is active, because both workflows could send messages or generate coupons. If a test fails, leave the replacement disabled, confirm the template code and customer context, review the queue or logs, and test again.