Description
Summary (*)
If the amqp module is not installed in your magento 2.4.4 instance and you want to use the ProductAlert module functionality you will never be able to send alert emails because when the cronjob catalog_product_alert is run there will be a critical error with the message: "Publisher 'product_alert' is not declared"
Steps to reproduce
- Set a specific product to be out of stock
- Go to frontend and subscribe to product inventory alert, so the customer gets notified as soon as the product is back in stock
- Make sure, that the customer alert appears in the product view in the admin area in the
Product Alerts
section. - Put the product back to stock
- To manually run this cron job from the CLI you could do this
mysql -e "INSERT INTO cron_schedule ( job_code, scheduled_at ) VALUES ( 'catalog_product_alert', CURENT_TIMESTAMP );" && php bin/magento cron:run
- You will directly get the error message
CRITICAL: Publisher 'product_alert' is not declared. [] []
- Activate
Magento_Amqp
and do the same again - The error will be gone
Examples (*)
.CRITICAL: Publisher 'product_alert' is not declared. [] []
is the error you can find in debug.log after running bin/magento cron:run when the cronjob catalog_product_alert is trying to send an alert.
Proposed solution
Add the amqp module as a dependency for the ProductAlert module, both in composer and in the module.xml
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
- Severity: S0 - Affects critical data or functionality and leaves users with no workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.