В обработчике OnAfterIBlockElementAdd переопределяете всё, что хотите и отправляете через CEvent::SendImmediate
Пример:
AddEventHandler("iblock", "OnAfterIBlockElementAdd", Array("CIBlockHandlers", "OnAfterIBlockElementAddHandler"));
class CIBlockHandlers{
function OnAfterIBlockElementAddHandler(&$arFields){
if( $arFields["ID"] > 0 ){
$arFilter = Array("ID" => $arFields["ID"] );
$arSelect = Array("ID", "IBLOCK_CODE","NAME", "PROPERTY_TEXT", "PROPERTY_PHONE", "PROPERTY_EMAIL");
$res = CIBlockElement::GetList(array("SORT"=>"ASC"), $arFilter, false, false, $arSelect);
while( $ob = $res->GetNextElement() ){
$arFields2 = $ob->GetFields();
if($arFields2["IBLOCK_CODE"]=="complaints"){
$arFieldsEmail = array(
"PHONE" => $arFields2["PROPERTY_PHONE_VALUE"],
"EMAIL_FROM_1" => $arFields2["PROPERTY_EMAIL_VALUE"],
"TEXT" => $arFields2["PROPERTY_TEXT_VALUE"],
);
CEvent::SendImmediate("MAIL_DIRECTOR","s1",$arFieldsEmail);
}
}
}
else
AddMessage2Log("Ошибка добавления записи (".$arFields["RESULT_MESSAGE"].").");
}
}