S
S
sergeyviktorovich2021-06-11 11:44:52
1C-Bitrix
sergeyviktorovich, 2021-06-11 11:44:52

How to pass additional parameters to an email when changing an order?

this event does not work AddEventHandler("sale", "OnSaleStatusOrderChange", "bxModifySaleMails");

AddEventHandler("sale", "OnOrderNewSendEmail", "bxModifySaleMails");
/*AddEventHandler("sale", "OnSaleStatusOrderChange", "bxModifySaleMails");*/
function bxModifySaleMails($orderID, &$eventName, &$arFields)
{
$order_props = CSaleOrderPropsValue::GetOrderProps($orderID)->Fetch();

$arFields["DELIVERY_TIME"] = $order_props["DELIVERY_TIME"];
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Gritsuk, 2021-06-11
@winer

You need the OnBeforeEventAdd
event In the handler, check the passed mail event type for the one you use to notify about order changes, and add the required fields

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question