src/log/Logger.php
private static function invokeMailHandler($loggable, $level, array &$context) {
        if (!key_exists('mailSubject', $context) || !key_exists('mailMessage', $context))
            self::composeMailMessage($loggable, $level, $context);

        $subject = $context['mailSubject'];
        $message = $context['mailMessage'];

        /** @var ConfigInterface $config */
        $config  = self::di('config');
        $options = $headers = [];
        $sender  = null;

        if (strlen($name = $config->get('log.mail.profile', ''))) {
            $options = $config->get('mail.profile.'.$name, []);
            $sender  = $config->get('mail.profile.'.$name.'.from', null);
            $headers = $config->get('mail.profile.'.$name.'.headers', []);
        }
        static $mailer; !$mailer && $mailer=Mailer::create($options);

        foreach (self::$mailReceivers as $receiver) {
            $mailer->sendMail($sender, $receiver, $subject, $message, $headers);
        }
    }
private static function invokeMailHandler($loggable, $level, array &$context) {
        if (!key_exists('mailSubject', $context) || !key_exists('mailMessage', $context))
            self::composeMailMessage($loggable, $level, $context);

        $subject = $context['mailSubject'];
        $message = $context['mailMessage'];

        /** @var ConfigInterface $config */
        $config  = self::di('config');
        $options = $headers = [];
        $sender  = null;

        if (strlen($name = $config->get('log.mail.profile', ''))) {
            $options = $config->get('mail.profile.'.$name, []);
            $sender  = $config->get('mail.profile.'.$name.'.from', null);
            $headers = $config->get('mail.profile.'.$name.'.headers', []);
        }
        static $mailer; !$mailer && $mailer=Mailer::create($options);

        foreach (self::$mailReceivers as $receiver) {
            $mailer->sendMail($sender, $receiver, $subject, $message, $headers);
        }
    }
private static function invokeMailHandler ( $ loggable , $ level , array & $ context ) { if ( ! key_exists ( 'mailSubject' , $ context ) || ! key_exists ( 'mailMessage' , $ context ) ) self :: composeMailMessage ( $ loggable , $ level , $ context ) ; $ subject = $ context [ 'mailSubject' ] ; $ message = $ context [ 'mailMessage' ] ; /** @var ConfigInterface $config */ $ config = self :: di ( 'config' ) ; $ options = $ headers = [ ] ; $ sender = null ; if ( strlen ( $ name = $ config -> get ( 'log.mail.profile' , '' ) ) ) { $ options = $ config -> get ( 'mail.profile.' . $ name , [ ] ) ; $ sender = $ config -> get ( 'mail.profile.' . $ name . '.from' , null ) ; $ headers = $ config -> get ( 'mail.profile.' . $ name . '.headers' , [ ] ) ; } static $ mailer ; ! $ mailer && $ mailer = Mailer :: create ( $ options ) ; foreach ( self :: $ mailReceivers as $ receiver ) { $ mailer -> sendMail ( $ sender , $ receiver , $ subject , $ message , $ headers ) ; } }
Send the message to the configured mail receivers.

@param  string|\Exception $loggable - message or exception to log
@param  int               $level    - loglevel of the loggable
@param  array             $context  - reference to the log context with additional data
Send the message to the configured mail receivers .