Exemplo n.º 1
0
 public static function SendProductionEmail($deal_id)
 {
     $arFieldmail = array();
     $comid = CArkaCrm::GetCompanyIDByDealID($deal_id);
     $email = CArkaCrm::GetEmailByCompanyID($comid);
     $arFieldmail['EMAIL_TO'] = $email;
     $scet = CArkaCrm::GetDocNumberForDeal($deal_id);
     $arFieldmail['INVOICE'] = $scet;
     $sm = CArkaCrm::GetDealCostOriginal($deal_id);
     $arFieldmail['SUMMA'] = sprintf('%.2f', $sm);
     $arFieldmail['SUBJECT'] = 'SMART ' . $deal_id . '. Счет ' . $scet;
     //deb
     //AddMessage2Log('arFieldsmail (production) is ' . serialize($arFieldmail));
     $event = new CEvent();
     $event->Send('BP_PRODUCTION', SITE_ID, $arFieldmail);
     // temporary to debug
     $arFieldmail['EMAIL_TO'] = '*****@*****.**';
     $event = new CEvent();
     $event->Send('BP_PRODUCTION', SITE_ID, $arFieldmail);
 }