Approaches to configure Email Notification Settings.

Created by Baz ‎‎, Modified on Wed, 8 Jan at 1:57 AM by Baz ‎‎

Approach 1: Notifications via Scheduled tasks

Scheduled tasks are automatically run at specified time intervals. In this approach, notifications are sent to customers at regular intervals without needing manual interference.


How It Works:

  • The system uses the scheduled task runner of Shopware to run notifications at predetermined times.
  • A scheduled task is registered in the 'scheduled_task' table in your database.
  • Once a product comes back in stock, the scheduled tasks will automatically pick it up on the next run if customers who have signed up for notifications.
  • The system then sends a "Back in Stock" alert to those customers.


What are scheduled tasks and how to configure them?


In Shopware, scheduled tasks are tasks that are set to run automatically at specific times or intervals.


These tasks can be used for:

  • Cleaning up old data
  • Sending email notifications
  • System checks

For more detailed information regarding the Shopware tasks and how to configure them on a production system, please refer to the link: https://developer.shopware.com/docs/guides/hosting/infrastructure/scheduled-task.html


In Shopware 6.6 the scheduled task now often relies on the message queue. A message queue is a system used to handle tasks that need to be processed in the background.


The message queue needs to be configured separately and relies on various commands and infrastructure. Many shops use the Admin Worker, but this is unstable and not recommended


For more detailed information regarding the Message Queue and how to configure it for production environments, please refer to the link: 

https://developer.shopware.com/docs/guides/hosting/infrastructure/message-queue.html


Approach 2: Notifications through Backend Configuration (Using Flow Builder)

This approach allows you to control the notification process more dynamically through the backend by enabling a setting called "Using Flow Builder".


Note that when using Pickware ERP it is advisable to use the scheduled task instead, due to the fact that pickware does not trigger stock changes like Shopware does. We try to say compatible and up to date but cannot guarantee every plugin version is compatible with every Pickware ERP version.


How It Works:

  1. Create a new Flow

    1. Navigate to Settings > Flow Builder

    2. Click the "Add Flow" button in the top right corner

    3. Give the flow a name e.g. "Back in stock notification flow" and set it to 'active'

    4. Open the "Flow" tab and select the "Back in stock" trigger

    5. Add the "Send mail" action and select the back in stock mail template

    6. Now safe the flow and double check it's enabled

  2. Enable "Using Flow Builder":

    • Navigate to the backend of your website where the plugin is installed.
    • Locate the switch labeled "Using Flow Builder".
    • Enable this switch as per the screenshot: https://prnt.sc/tRktR-NfMhsG
    • When the switch is enabled, the Scheduled Tasks will automatically be disabled.
    • Once Flow Builder is enabled, you can create a new flow for the "Back in Stock" notification.
    • The flow will automate the process of sending notifications to customers when the product is available again.
    • To create a flow, please refer to the reference video: https://www.awesomescreenshot.com/video/34952962?key=585b1ffb846878895cb4c92c02f2f60f


Approach 3: Notifications via Command Line

This approach allows you to manually control the notification process through the command line. If, for some reason, your scheduled tasks are not working and emails are not being sent, you can use this method to trigger the email notifications manually.


How It Works:

  1. Open your command line interface.
  2. Run the bin/console command.
  3. Scroll to the bottom of the list to find the category labeled "zeo".
  4. Locate the command zeo:stock-subscriber:notify
  5. To execute the notification command, use the following syntax : bin/console zeo:stock-subscriber:notify


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article