by Krishna Gajera on WordPress.org
Generate unique discount coupon codes automatically when a Gravity Form is submitted. Optionally email the code to the user.

Settings page - Coupon Generate Form Settings section.
Auto Coupon Generate for Gravity Forms lets you automatically create a unique discount coupon code every time a visitor submits a Gravity Form. The generated code is saved directly as a Gravity Forms coupon and can optionally be emailed to the user straight away – no manual work required.
A common use case is a two-step flow: a user fills out a registration or survey form, receives a unique coupon code by email, and then uses it on a subsequent order form to claim their discount.
Key Features
{coupon_code} placeholder anywhere in the message body.random_int() for cryptographically safe code generation, proper nonce verification, and capability checks on all admin pages.Requirements
The plugin will check for these dependencies on activation and will not activate if either Gravity Forms or the Coupons Add-On is missing.
After activating the plugin, go to Generate Coupon Setting in the WordPress admin menu. The settings page is divided into three sections.
These settings control how coupon codes are generated and what discount they carry.
gform_field_value_uuid filter). This is typically a hidden field.SALE- would produce codes like SALE-A3BX92KQ.SUMMER-). Leave blank for no prefix.1234567890QWERTYUIOPASDFGHJKLZXCVBNM. You can narrow this down – for example, removing easily confused characters like 0, O, 1, and I.10 for $10 off).1 to make it single-use.MM/DD/YYYY format. Leave blank to make it valid immediately.MM/DD/YYYY format. Leave blank for no expiry.These settings are all optional. If you do not enable email notifications, coupons are still generated and saved – users just will not receive an automatic email.
Your Coupon Code.{coupon_code} anywhere in the text and it will be replaced with the actual generated code before sending. Default message is provided but you can customise it freely.The email is sent using WordPress’s built-in wp_mail() function. Delivery depends on your server’s mail configuration or any SMTP plugin you have installed.
Go to Generate Coupon Setting > Coupon Log in the WordPress admin to see a table of every coupon that has been generated by the plugin. The table shows the coupon code, the form it was generated from, and the date and time it was created. The log displays the 100 most recent entries in reverse chronological order.