Answer the question
In order to leave comments, you need to log in
How to automatically change the status of a lead after reading a letter in Bitrix24 (cloud)?
How to automatically change the status of a lead after reading a letter in Bitrix24 (cloud)?
Answer the question
In order to leave comments, you need to log in
Set a trigger that the letter has been read in the status in which you need to transfer the lead.
Robots are not available on the free plan, but you can use the Rest API
. To do this, you need to create an outgoing webhook for the Case Update event, specify a link to the handler, and write the following code in the handler itself (you will need the CRest SDK class to work ):
require __DIR__.'/crest.php';
if($_REQUEST['event'] == 'ONCRMACTIVITYUPDATE') {
$activityID = $_REQUEST['data']['FIELDS']['ID'];
$activity = CRest::call('crm.activity.get', ['ID' => $activityID]); // получаем информацию о деле
// проверяем, что письмо было отправлено лиду, а не другой crm-сущности, а также что поле даты прочтения письма не пустое
if($activity['result']['OWNER_TYPE_ID'] == 1 && !empty($activity['result']['SETTINGS']['READ_CONFIRMED'])) {
// переводим лид в нужный статус
$updateLead = CRest::call('crm.lead.update', [
'ID' => $activity['result']['OWNER_ID'],
'FIELDS' => [
'STATUS_ID' => 'IN_PROCESS'
]
]);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question