Email

LicenceForge includes a built-in email notification system that automatically sends transactional emails at key points in the license lifecycle. All emails are fully customisable through the admin template editor, support variable substitution, and can be previewed and tested before going live.

Overview

The email system ships with 6 transactional templates that cover the full license lifecycle — from initial purchase through expiry warnings, renewals, key rotations, and suspensions. Each template is triggered automatically by its corresponding license event and populated with dynamic data using a variable substitution system.

Emails are sent via wp_mail(), making the system fully compatible with any SMTP plugin (WP Mail SMTP, Post SMTP, FluentSMTP, etc.) for delivery through external mail providers.

6 Email Templates

LicenceForge provides the following templates out of the box:

Template Trigger Purpose
license_created Purchase (Stripe or WooCommerce) Delivers the license key to the customer after purchase
trial_created Trial requested Sends trial license details and duration
license_expiring Daily cron (7 days before expiry) Warns the customer their license is about to expire
license_renewed License renewal Confirms renewal and provides the new expiry date
license_key_rotated Key rotation Delivers the new license key after rotation
license_suspended License suspension Notifies the customer their license has been suspended

Each template has a configurable subject line and HTML body. For full details on every template, its trigger conditions, and available variables, see Email Templates.

Variable Substitution

All templates use a curly-brace variable syntax. When an email is sent, LicenceForge replaces each variable placeholder with the corresponding real data from the license record, product, or site configuration.

Variable syntax

Variables use the format {variable_name}. For example, {customer_name} is replaced with the customer's name, and {license_key} is replaced with the actual key.

Variables fall into two categories:

  • Template-specific variables — data unique to each template's context, such as {license_key}, {trial_days}, or {suspend_reason}.
  • Global variables — available in every template: {site_name}, {site_url}, {brand_name}, and {support_url}.

See the full variable reference for a complete list.

Customisable Editor with Preview and Test

The template editor is accessible from LicenceForge > Email Templates in the WordPress admin. It provides:

  • A sidebar template selector to switch between the 6 templates
  • Editable subject and body fields with HTML support
  • A variable insert bar with clickable variable codes
  • Live preview rendering in a 500px iframe
  • A Send Test Email button for delivery verification
  • A Reset to Default option to restore the original template

For a walkthrough of the editor interface and all its features, see Template Customisation.

Configuration

Email behaviour is controlled through a set of options in the LicenceForge settings panel:

  • Master toggle — enable or disable all email notifications with wplf_email_notifications
  • Sender identity — set the from name and from address for outgoing emails
  • Branding — configure brand name, colour, logo, and support URL to match your emails to your brand
  • Expiry warnings — the check_expiring_licenses cron job runs daily and triggers the expiry warning email 7 days before a license expires

For the full settings reference, see Email Configuration.

Pages in This Section