I
I
itemashabanov2021-02-19 15:53:03
1C-Bitrix
itemashabanov, 2021-02-19 15:53:03

How to resume sending email?

Good afternoon. When buying a product in one click, a letter about such an order and a letter with information about this order are sent to the site's mail (this letter is also sent to the buyer). There are two different events for these two letters, and the second one is called by the CSaleOrder::DoSaveOrder method. Since this event also fires when ordering through the cart, in this case it is necessary that an order letter be sent to both the admin and the client (as it is now done). The question is how to cancel sending the second letter to the admin mail when buying in one click? Thought to do it

\Bitrix\Sale\Notify::setNotifyDisable(true);
$ORDER_ID = (int)CSaleOrder::DoSaveOrder($arOrderDat, $arOrderFields, 0, $arResult["ERROR"]);

Bitrix\Sale\Notify::setNotifyDisable(false);
CEvent::Send("SALE_NEW_ORDER_FAST", htmlspecialcharsbx($_GET["SITE_ID"]), "", "N", 222);

But in this case, CEvent::Send no longer works.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question