SteelCode
steelcode.dev
Product Expiration Date

Emails and processing

Run expiry processing, configure mail delivery, and understand the scheduled task and Messenger queue.

Emails and processing

The plugin uses Shopware's scheduled-task system and Messenger queue. It is designed to process large catalogues in batches instead of loading every expiring product at once.

What the daily task does

The daily task steelcode_expiration_date.process:

  1. invalidates product caches at relevant discount transitions;
  2. deactivates eligible expired products in batches; and
  3. queues eligible notification batches for Messenger.

The task does not send emails itself. Messenger sends the queued emails afterwards.

Production requirement

Keep Shopware's scheduled-task runner and a persistent Messenger worker running in production. The Administration worker may process messages while an administrator is logged in, but it is not a replacement for a server-side worker.

If the task or worker is not running, dates can still be shown and discounts can still be calculated at request time, but automatic deactivation, cache-transition processing, and notification delivery will be delayed.

Manual processing

Run the same processing manually after changing dates, during testing, or when diagnosing an issue:

bin/console steelcode:expiration-date:process

Email template and recipients

Notification emails are sent to the addresses configured in the plugin, not to the current Administration user. The installed Product expiration date mail template contains the product name, product number, expiration date, and a direct Administration link.

You can edit it in Settings → Email templates. Preserve the supplied template variables, especially product, expirationDate, notification, shopName, and adminProductUrl, so the template continues to render correctly.

Shopware’s Administration worker can consume messages while Administration is open. In production, run a persistent Messenger worker so emails are delivered even when nobody is logged in.

bin/console messenger:consume -vv

Logs

Plugin activity and failures are recorded in var/log/steelcode_expiration_date.log. Check this file first when a notification is missing or a scheduled process fails.