magento-2-smtp icon indicating copy to clipboard operation
magento-2-smtp copied to clipboard

Emails not being sent with Mageplaza SMTP with Cron actions

Open paugnu opened this issue 3 years ago • 5 comments

Preconditions (*)

  1. Magento 2.4.2-p1
  2. I'll explain the issue with the specific problem we're having: email product stock alerts are not being sent with Mageplaza SMTP modules. Other shop emails are sent correctly.

Steps to reproduce (*)

  1. Enable product alert stock in backoffice (Stores » Configuration » Catalog » Product Alerts)
  2. Set a product stock to 0 and subscribe to it on the frontend
  3. Set the product stock to 1 and force the catalog_product_alert cron to be executed (either from Mageplaza Cron module or just wait for the next day)

Expected result (*)

  1. Stock Alert table should be updated
  2. Stock alert email should be sent and Mageplaza SMTP logs should display the email

Actual result (*)

  1. Stock Alert table should be updated (this is correct, and it indicates that the logic of the module seems to work fine)
  2. Stock alert email is not sent (at least it is not sent with Mageplaza SMTP module). The email is not in the email logs.

Notes

  • If I use n98-magerun2 to execute the cron task, it works fine (emails are sent and stored with Mageplaza)
  • All data in database is correct, it seems that everything is executed as expected: but there is no trace of any email sent
  • It seems to me like if emails sent from Cron tasks are avoiding Mageplaza SMPT module

paugnu avatar Jun 02 '21 11:06 paugnu

Hi,

For emails sent from Cron tasks, it is processed in core, the Smtp module is not involved in processing, so it does not support sending emails from Cron tasks.

Hope my answer will be of help to you. Thank you!

HuyPhuc98 avatar Jun 03 '21 04:06 HuyPhuc98

Thanks for clarifying this, Huy.

Is there a way to implement this? Any plans of doing so?

paugnu avatar Jun 03 '21 04:06 paugnu

I can't customize the Smtp module to solve this problem for you. We have no plans for this at the moment.

Thank you!

HuyPhuc98 avatar Jun 03 '21 08:06 HuyPhuc98

Thanks, Huy. No problem, :) If I have the time, I'll check it myself.

Should we keep this ticket open in case someone solves it in the future?

paugnu avatar Jun 03 '21 09:06 paugnu

If that's what you want, I'll keep this ticket open until someone solves your problem. Thank you!

HuyPhuc98 avatar Jun 03 '21 10:06 HuyPhuc98