public function __construct($isCritical, $emailEvent, $fieldsUppercase = TRUE, $siteId = SITE_ID)
 {
     parent::__construct($isCritical);
     $this->emailEvent = $emailEvent;
     $this->fieldsUppercase = $fieldsUppercase;
     $this->siteId = $siteId;
 }
 public function __construct($isCritical, $iBlockId, $elementName = NULL, $fieldsUppercase = TRUE, array $bitrixFields = array())
 {
     parent::__construct($isCritical);
     $this->iBlockId = $iBlockId;
     $this->elementName = $elementName;
     $this->fieldsUppercase = $fieldsUppercase;
     $this->bitrixFields = $bitrixFields;
 }
 /**
  * @param $isCritical
  * @param $body
  * @param array $to
  * @param array $from
  * @param null $subject
  * @param array $files
  *
  * TODO: https://php.net/manual/ru/function.array-replace.php - передавать опции массивом, использовать array_replace для дефолтных значений
  * TODO: передавать объект PHPMailer, а не хардкодить путь к нему
  */
 public function __construct($isCritical, \PHPMailer $phpMailer, $options)
 {
     parent::__construct($isCritical);
     $this->mailer = $phpMailer;
     $defaultOptions = array('to' => array(cp_get_site_email()), 'from' => array("noreply@{$_SERVER['HTTP_HOST']}"), 'subject' => 'Сообщение на ' . $_SERVER['HTTP_HOST'], 'body' => '', 'files' => array());
     $options = array_replace($defaultOptions, $options);
     $this->to = $options['to'];
     $this->from = $options['from'];
     $this->subject = $options['subject'];
     $this->body_template = $options['body'];
     $this->files = $options['files'];
 }