Can I generate a random coupon code using a token?
Yes, recent versions of Coupon Manager support random coupon code generation using OpenUI or Page Template tokens. Use the "check for upgrade" link to download the current release. The token format is
%module|DEN_COUPON|create(coupon_code,prefix,random_length,days_to_expire)|%
- coupon_code must be a coupon you have already created in Coupon Manager. All settings (coupon amount, minimum subtotal, etc.) for that coupon will be used to generate the random coupon.
- prefix, if used, will be the first characters of the coupon. This makes it easy to reference later. For example, to view all randomly generated coupons from this token in the coupons console, just search by the prefix.
- length is the number of random characters to use for the coupon code after the prefix.
- days_to_expire is the number of days from the date the coupon is generated for which it is valid. If left blank, the coupon will use the expiration date of the original coupon_code.
For example, the following token will generate a coupon code in the format AUTO-XXXXX (where 'XXXXX' is randomly generated) that will expire in 24 hours, otherwise using all settings from the coupon MYCOUPON.
%module|DEN_COUPON|create(MYCOUPON,AUTO-,5,1)|%
The following example shows how to include a random coupon using OpenUI Tokens in the customer confirmation email.
1) First, register a token for Coupon Manager in the tokens tab of your store settings. Use DEN_COUPON for the module code and token name.
2) In the Header field of the Customer Order Confirmation Email tab (in Order Fulfillment Configuration), place %OUI% at the very top.
3) Include the following where you want the coupon to display in the header.
Your order qualifies for an automatic coupon! Use the coupon code %module|DEN_COUPON|create(MYCOUPON,AUTO-,5,10)|% to receive %10 off your next order, offer valid for the next 10 days.
Of course, you can wrap this in other OUI Token checks. For example, the following conditional token would only generate a coupon if the order total is $100 or more.
%IF(Orders.d.total GE 100)%
Your order qualifies for an automatic coupon! Use the coupon code %module|DEN_COUPON|create(MYCOUPON,AUTO-,5,10)|% to receive %10 off your next order, offer valid for the next 10 days.
%IFEND%
Last update: 2004-09-30 04:51
Author: Support
Revision: 1.0
You cannot comment on this entry
Most Recent FAQ Entries: 
- I have the module configured to add the key ... (2008-08-13 14:50)
- What is the format for the htaccess file if ... (2008-08-12 14:50)
- Is there any way to look up a customer's ... (2008-08-06 18:04)
- I am looking for a module that will allow ... (2008-08-06 18:00)
- Is it possible to display a link in Phone ... (2008-08-06 12:05)
Top 10 
- 2754 views:
Adding Tokens to Evaluate Expressions - 2698 views:
Is there a way to "Limit" the number of ... - 2654 views:
Why won't you call me for technical support? I ... - 2549 views:
Are license keys valid for more than one store? ... - 2447 views:
I'm trying to enter a license key and get ... - 2425 views:
How do I install a module? - 2286 views:
How do I check for a module upgrade? - 2255 views:
How can display and change the parameters of an ... - 2097 views:
The total on my checkout pages are not correct. ... - 1932 views:
I have select and radio type attributes in my ...
















