A
A
Andrey Bely2021-01-20 23:44:39
1C-Bitrix
Andrey Bely, 2021-01-20 23:44:39

Prohibit sending mail and SMS messages about the order, if the user settings in the field "Not returned" is "No"?

Good night to all bright minds and hard workers :)
On the site, after paying for the order, the user is sent an email and SMS to the phone with information.
The customer wants:
If in the user's settings in the "Not returned" field is "No", then after paying for the order, neither a letter nor an SMS is sent to him.
60089530452fc725218860.png

I have thoughts on how to do this, but maybe someone faced such a task, please share your experience)
The Yu.money payment system is used

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Y
Yaroslav Alexandrov, 2021-01-21
@alexyarik

On the site after payment of the order

- this is a change in the status of an order, see "Saving an order: special events"
https://dev.1c-bitrix.ru/api_d7/bitrix/sale/events... event "order status change" in Bitrix? // get order properties $arOrder = CSaleOrder::GetByID(); // get user properties $arOrder['USER'] = CUser::GetByID($arOrder['USER_ID'])->Fetch();
via the OnOrderNewSendEmail event to cancel sending an email about the order, the OnOrderNewSendEmail event handler must return false otherwise the email will be sent. Or call the \Bitrix\Sale\Notify::setNotifyDisable(true); method in your code. , then sending a system email about adding an order will be disabled. There is also an OnBeforeEventAdd event, in its handler you must also return false.

N
Negwereth, 2017-05-30
@Negwereth

And why should?
You haven't set anything other than delay.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question