Skip to content

When a license is restored

Sends a notification when a soft-deleted Digital Product License is restored from the trash. Use this to notify the customer their access has been re-enabled after a reversal.

Can't be restored from the control panel

The Digital Products plugin doesn't provide a "Restore" option from the control panel.

This event will only fire when a License is restored programmatically via Craft::$app->getElements()->restoreElement() or the php craft elements/restore <id> console command.

Requires Digital Products

Only available when the Digital Products plugin is installed.

Digital Product Type Filters

Choose which Digital Product types should fire this notification. Only products of the selected types will trigger it.

For license events, the filter checks the parent product's type instead.

Selection is required

Check at least one product type, or the notification won't fire.

Field Conditions

Field conditions restrict the notification based on the element's content, using Craft's native conditions framework. Build a rule set against the element's attributes and field values, and the notification will be sent only when every rule matches.

Must match all conditions

The condition builder evaluates every rule with AND semantics, so each rule must pass for the notification to be sent.

Twig variables

The object variable (and its license alias) is the restored License element.

twig
License {{ license.licenseKey }} for "{{ license.product.title }}" was restored.

Examples

Restore notification for the customer

twig
Hi {{ license.licensedTo }},

Your license for {{ license.product.title }} has been restored.

Your key: {{ license.licenseKey }}