msDeferredMessages

Postponed messages after change of order status
Packages
22
Downloads
5 579
Usually answers more than a week
Автор дополнения
Packages
22
Downloads
5 579
Usually answers more than a week
Version 1.0.11-pl
Release date 05.08.2020
Downloads 25
Views 2 058
Warning! This component requires PHP version 5.6 or higher! If your site uses PHP less than required, the installation of this package could break it.
The application for the automatic sending of email messages to buyers of the online store after a specified number of hours, after changing the status of the order.

Using the trigger email mailing list you will be able to return your customers to the site.
In letters you can offer to buy additional products or remind you to leave feedback.

Video showing the work of the application
https://youtu.be/KSP47kt_dYA

Example of use
  1. Create a topic send a letter to the buyer in 3 hours if the order status is new.
  2. The buyer makes out an order and for some reason did not pay.
  3. After sending the order passes 3 hours
  4. The script checks the message queue
  5. And sends a new letter requesting payment for the order


Application settings




Themes of creating messages


You can set unlimited number of topics that will track order statuses and create new messages with different frequency of sending messages.


Topic name
Sets arbitrarily

Send email via
Specify the number of hours after how much to send a message to the user

After transferring the order to the status
after the status change to the event msOnChangeOrderStatus the plug-in works and checks the availability of the topic with the new order status

Clean the queue after the status
It happens that our order changes its status several times, but the deferred message is created for each of our statuses. In this way, you can delete the previous messages in the queue

If the status of the order has changed, the message is not sent
If Yes is set, an order created with the New status will not be sent if the order has been changed to Paid or some other order.

Themes and chunks
They work the same way as when creating a new status in the minishop (all placeholders are exactly the same as when sending an order normally)

Message Queuing


After placing the order by the buyer, our order received the status of New. Since the theme for this status was configured, the component automatically queued for sending the message in 2 hours.

Additionally, the status of the distribution script is displayed in the queue tab. Where you can see the start and end date of the crontab job execution
for testing, a push button for sending a message has been added



Crontab


To automate the sending of pending messages, you must configure crontab.

*/1 * * * * /usr/bin/php ~/www/core/components/msdeferredmessages/cron/sendmessage.php

Attention!!! Adjustment of the cron job is mandatory. Otherwise, the messages will be in the queue

System settings


max_limit_message — Maximum message sending limit
The maximum limit for sending messages at a time. Depending on your php settings, you need to specify how many messages will be left

msdeferredmessages_last_start_run_crontab — The latest start date for the job crontab
The default is empty. Date of the script execution for the distribution core/components/msdeferredmessages/cron/sendmessage.php

msdeferredmessages_last_end_run_crontab — The last date the crontab job was completed
The default is empty. The expiration date of the script execution for the mailing core/components/msdeferredmessages/cron/sendmessage.php

Discussion of the component in community MODX.PRO.

1.0.11-pl

  • Убрана ошибка

1.0.10-pl

  • Исправлен баг проверки статуса при смене на новый

1.0.9-pl

  • Сделан публичным метод removesQueue

1.0.8-pl

  • Обновление событий

1.0.7-pl

  • Добавлены события msDeferredMessagesBeforeAddQueue и msDeferredMessagesAfterAddQueue во время добавления сообщения в очередь. Переменные $queue - msDeferredMessagesQueue и $order - msOrder
  • Добавление событие OnUserBeforeRemove для удаления сообщения из очереди если пользователь был удале то и очередь сообщений удаляется. Для этого дополнительно было добавлени поле user_id к объекту msDeferredMessagesQueue
  • Во время первой установки автоматически добавляется сообщение для новых заказов. Такми образом все заказ со статусом новый будут отправляться пользователю в случае если он создал но не оплатил заказ
  • Добавлен чанк с письмом для отправки пользователю для нового заказа с ссылкой на оплату
  • Добавлена возможность отключения способов оплаты и доставки выбрав которые пользователь не получит сообщение при смене статуса заказа

1.0.6-pl

  • Исправлена отправка письма через cron

1.0.5-pl

  • Исправлена повторная отправка письма в процессоре отправляемом ручным методом

1.0.2-pl

  • Поддержка английского языка

1.0.1-pl

  • Исправлена опечатка
  • Исправлена исправлена обка в связях msDeferredMessagesSubject и msDeferredMessagesQueue
  • Добавлена возможность "Если изменился статус заказа то сообщение не отправляется"

1.0.0-pl

  • New build script.