Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Random Coupon Generator

1 sites No security coverage
View on drupal.org

This module generates a large number of unique coupon codes using a prime-based algorithm. You can configure the coupon length, character set, and prefixes/suffixes, and then choose to display the codes on screen or download them as a CSV file.

A small Drupal 10 admin module that generates large numbers of unique, non-sequential coupon codes using a prime-based obfuscation algorithm

It provides an admin settings form and a generator form with an option to either output generated codes on the page or export them as a CSV download.

The obfuscation algorithm is based on this blog post & the wotzebra/unique-codes package.

Features

  • Configure coupon length, character set, prefix & suffix.
  • Configure obfuscating and max primes used by the generator algorithm.
  • Generate large amounts of unique coupon codes in a single operation.
  • Choose output: show codes on the page or download a CSV file.

Configuration & usage

Settings form

Go to Admin → Configuration → System → Random coupon generator
(/admin/config/system/random-coupon-generator/settings)

Generator form

Admin → Configuration → System → Random coupon generator → Generate coupons
(/admin/config/system/random-coupon-generator/generate)

Additional Requirements

This module does not require other modules. It does require the wotzebra/unique-codes package (installed automatically via Composer).

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Oct 2025
Latest release
10 months ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Slowing

Release Timeline

Releases

Version Type Core Release date
1.0.0-beta2 Pre-release 9–11 Oct 27, 2025
1.0.0-beta1 Pre-release 9–11 Oct 27, 2025
1.0.x-dev Dev 9–11 Oct 27, 2025