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). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Custom Token

19 sites Security covered Drupal 9–11
View on drupal.org

This module allows administrators to create custom, environment-specific tokens without coding. Token keys are stored in configuration and exported, while their sensitive values are stored separately in the State API and are not exported, preventing accidental exposure in development or testing environments. These custom tokens can then be used like any other token throughout Drupal, including in webform email settings.

This module allows administrators to define dynamic tokens directly from the Drupal backend without writing code or touching configuration files for sensitive values.

How it works:

Two-store model:

  1. Token keys are saved to config - run drush config:export to commit them to the repository.
  2. Token values are saved to State API and are never exported - set them independently on each environment.

Token keys (machine names such as general_email, events_email) are stored in Drupal's Config API. These are exported via drush config:export and committed to the repository, so the token structure is consistent across all environments.

Token values (the actual email addresses or other environment-specific strings) are stored in Drupal's State API. State values are never exported and never committed to the repository.
Each environment - development, QA, production - sets its own values independently through the admin UI at /admin/config/system/custom_token_items.

Tokens are available site-wide as [custom_token:key] and can be used in:

  • Webform email handler fields (To, CC, BCC, options mapping)
  • Email subject lines and body text
  • Any other token-enabled field in Drupal

Why this approach:

Hardcoding client email addresses in webform configuration means they end up in the repository and get deployed to QA - creating a risk of test submissions reaching real recipients. This module eliminates that risk by keeping sensitive values out of the codebase entirely.

Depends on

Dependencies of the latest stable release

  • webform Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Jul 2026
Latest release
1 month ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
1.0.0 Stable 9–11 Jul 17, 2026
1.0.x-dev Dev 9–11 Jul 17, 2026