Skip to content

When a product is restored

Sends a notification when a soft-deleted Digital Product is restored from the trash.

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 Product 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 product alias) is the restored Digital Product.

twig
"{{ product.title }}" was restored from the trash.

Examples

Notify the merch team of a restore

twig
{{ product.title }} is back online.

- Restored by: {{ currentUser.fullName }}