Does not send the email to the event OnAfterIBlockElementAdd?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
19 views
Good day! do not send emails to mail when the event after adding the item in the InfoBlock Bitrix OnAfterIBlockElementAdd.

There is a form

form name="iblock_add" action=" method="post"
input type="text" name="name" placeholder="Your name"
input type="tel" name="phone" placeholder="phone Number"
input type="text" size="25" name="date" placeholder="Enter date"
input name="servise" type="text" value="<?=$arResult["NAME"]?>"
button name="submit" class="booking__btn btn btn-primary" type="submit"> Book /button

Upon clicking it, used the $element->Add($arLoadProductArray); adds a new item without problems.

After this addition, we need to implement the sending of this information from the completed forms in the mail.
what - created the post type event BOOKING
- created a template post event, where indicated:
Client name: "NAME"
Phone number: "PHONE"
The name of the service: "SERVISE"
Reservation date: "DATE"

and then created an init with contents:

<?<br/>//SEND DATA FROM FORMS TO THE ADMINISTRATOR AFTER DOBAVLENIYA IN INFORMATION BLOCK!!!

AddEventHandler("iblock", "OnAfterIBlockElementAdd", Array("MyClass3", "OnAfterIBlockElementAddHandler"));

class MyClass3
{
// create event handler "OnAfterIBlockElementAdd"
OnAfterIBlockElementAddHandler function(&$arFields)
{
if($arFields["IBLOCK_ID"]==5) {
$arEventFields= array(
"NAME" => $arFields["NAME"],
"PHONE" => $_REQUEST["PROPERTY"]["9"]["0"],
"SERVISE" => $_REQUEST["PROPERTY"]["24"]["0"],
"DATE" => $_REQUEST["PROPERTY"]["10"]["0"],
"SERVER_NAME" => "premium-relax.ru",
);
CEvent::Send("BOOKING", s1, $arEventFields, "N", 8);
}
}
}

?>

where 8 - id post event
The letter does not send, In what could be the error?
by | 19 views

2 Answers

0 like 0 dislike
Is not sent or does not come on the box to the receiver? You made sure somehow that they are not sent? What do you use for debugging?
by
0 like 0 dislike
already know about. The problem is in the hosting
by

Related questions

0 like 0 dislike
1 answer
asked Apr 29, 2019 by alexsemen94
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,187 answers
0 comments
40,796 users