public function sendToUser(
        SystemNotification $notification,
        DataObject $context,
        $user,
        $extraData = []
    ) {
        $channels = $this->channels;
        if ($extraData && isset($extraData['SEND_CHANNELS'])) {
            $channels = $extraData['SEND_CHANNELS'];
            unset($extraData['SEND_CHANNELS']);
        }

        if (!is_array($channels)) {
            $channels = [$channels];
        }

        foreach ($channels as $channel) {
            if ($sender = $this->getSender($channel)) {
                $sender->sendToUser($notification, $context, $user, $extraData);
            }
        }
    }
public function sendToUser(
        SystemNotification $notification,
        DataObject $context,
        $user,
        $extraData = []
    ) {
        $channels = $this->channels;
        if ($extraData && isset($extraData['SEND_CHANNELS'])) {
            $channels = $extraData['SEND_CHANNELS'];
            unset($extraData['SEND_CHANNELS']);
        }

        if (!is_array($channels)) {
            $channels = [$channels];
        }

        foreach ($channels as $channel) {
            if ($sender = $this->getSender($channel)) {
                $sender->sendToUser($notification, $context, $user, $extraData);
            }
        }
    }
public function sendToUser ( SystemNotification $ notification , DataObject $ context , $ user , $ extraData = [ ] ) { $ channels = $ this -> channels ; if ( $ extraData && isset ( $ extraData [ 'SEND_CHANNELS' ] ) ) { $ channels = $ extraData [ 'SEND_CHANNELS' ] ; unset ( $ extraData [ 'SEND_CHANNELS' ] ) ; } if ( ! is_array ( $ channels ) ) { $ channels = [ $ channels ] ; } foreach ( $ channels as $ channel ) { if ( $ sender = $ this -> getSender ( $ channel ) ) { $ sender -> sendToUser ( $ notification , $ context , $ user , $ extraData ) ; } } }
Sends a notification directly to a user
@param SystemNotification $notification
@param DataObject         $context
@param DataObject         $user
@param array              $extraData
Sends a notification directly to a user