Get the recipients of the given message.

@param  mixed  $notifiable
@param  \Illuminate\Notifications\Notification  $notification
@param  \Illuminate\Notifications\Messages\MailMessage  $message
@return mixed
7987
protected function getRecipients($notifiable, $notification, $message)
    {
        if (is_string($recipients = $notifiable->routeNotificationFor('mail', $notification))) {
            $recipients = [$recipients];
        }

        return collect($recipients)->mapWithKeys(function ($recipient, $email) {
            return is_numeric($email)
                    ? [$email => (is_string($recipient) ? $recipient : $recipient->email)]
                    : [$email => $recipient];
        })->all();
    }
213483
protected function sendToNotifiable($notifiable, $id, $notification, $channel)
    {
        if (!$notification->id) {
            $notification->id = $id;
        }
//        if (! $this->shouldSendNotification($notifiable, $notification, $channel)) {
//            return;
//        }
        $response = $this->manager->channel($channel)->send($notifiable, $notification);

//        $this->events->dispatch(
//            new Events\NotificationSent($notifiable, $notification, $channel, $response)
//        );
        return $response;
    }
595898
public function send(string $notifiable, Notification $notification)
    {
        $channelResult = $notification->toMail($notifiable);
        $messages = is_array($channelResult) ? $channelResult : [$channelResult];

        foreach ($messages as $message) {
            if (! $message instanceof Message) {
                throw new \Exception("Message needs to be an instance of craft\mail\Message");
            }

            $message->send();
        }
    }
197818
public function toMail($notifiable)
    {
        $mailMessage = (new MailMessage)
            ->error()
            ->subject($this->getMessageText())
            ->line($this->getMessageText());

        foreach ($this->getMonitorProperties() as $name => $value) {
            $mailMessage->line($name.': '.$value);
        }

        return $mailMessage;
    }
1133551
public function send($notifiable, Notification $notification)
    {
        return $notifiable->routeNotificationFor('database', $notification)->create(
            $this->buildPayload($notifiable, $notification)
        );
    }
623949
public function send($notifiable, LaravelNotification $notification)
    {
        $entity = $this->getEntity($notifiable, $notification);

        if ($channel = $notifiable->routeNotificationFor('doctrine')) {
            $em = $this->registry->getManager($channel);
        } else {
            $em = $this->registry->getManagerForClass(get_class($entity));
        }

        if (is_null($em)) {
            throw new NoEntityManagerFound;
        }

        $em->persist($entity);
        $em->flush();
    }
204629
public function send($notifiable, Notification $notification)
    {
        $message = $notification->toBearyChat($notifiable);

        if (! $message instanceof Message) {
            throw CouldNotSendNotification::invalidMessage($message);
        }

        if ($route = $notifiable->routeNotificationFor('BearyChat')) {
            if (Str::startsWith($route, ['@', '#'])) {
                $message->to($route);
            } elseif (Str::startsWith($route, ['http://', 'https://'])) {
                if ($client = $message->getClient()) {
                    $client->webhook($route);
                } else {
                    $message->setClient(new Client($route));
                }
            } else {
                $message->setClient($this->clientManager->client($route));
            }
        }

        if (is_null($message->getClient())) {
            $message->setClient($this->clientManager->client());
        }

        if (! $message->send()) {
            throw CouldNotSendNotification::sendingFailed($message->getClient()->getWebhook(), $message);
        }
    }
74266
protected function addressMessage($mailMessage, $notifiable, $notification, $message)
    {
        $this->addSender($mailMessage, $message);

        $mailMessage->to($this->getRecipients($notifiable, $notification, $message));

        if (! empty($message->cc)) {
            foreach ($message->cc as $cc) {
                $mailMessage->cc($cc[0], Arr::get($cc, 1));
            }
        }

        if (! empty($message->bcc)) {
            foreach ($message->bcc as $bcc) {
                $mailMessage->bcc($bcc[0], Arr::get($bcc, 1));
            }
        }
    }
1115628
public function toMail($notifiable)
    {
        $content = trans('notifications.incident.new.mail.content', [
            'name' => $this->incident->name,
        ]);

        return (new MailMessage())
                    ->subject(trans('notifications.incident.new.mail.subject'))
                    ->markdown('notifications.incident.new', [
                        'incident'               => $this->incident,
                        'content'                => $content,
                        'actionText'             => trans('notifications.incident.new.mail.action'),
                        'actionUrl'              => cachet_route('incident', [$this->incident]),
                        'unsubscribeText'        => trans('cachet.subscriber.unsubscribe'),
                        'unsubscribeUrl'         => cachet_route('subscribe.unsubscribe', $notifiable->verify_code),
                        'manageSubscriptionText' => trans('cachet.subscriber.manage_subscription'),
                        'manageSubscriptionUrl'  => cachet_route('subscribe.manage', $notifiable->verify_code),
                    ]);
    }
1134072
public function send($notifiable, Notification $notification)
    {
        $subscriptions = $notifiable->routeNotificationFor('WebPush');

        if (! $subscriptions || $subscriptions->isEmpty()) {
            return;
        }

        $payload = json_encode($notification->toWebPush($notifiable, $notification)->toArray());

        $subscriptions->each(function ($sub) use ($payload) {
            $this->webPush->sendNotification(
                $sub->endpoint,
                $payload,
                $sub->public_key,
                $sub->auth_token
            );
        });

        $response = $this->webPush->flush();

        $this->deleteInvalidSubscriptions($response, $subscriptions);
    }
590850
public function send($notifiable, Notification $notification)
    {
        $message = $notification->toHipChat($notifiable);

        if (is_string($message)) {
            $message = new HipChatMessage($message);
        }

        if (! in_array(get_class($message), [HipChatMessage::class, HipChatFile::class])) {
            throw CouldNotSendNotification::invalidMessageObject($message);
        }

        $to = $message->room ?: $notifiable->routeNotificationFor('HipChat');
        if (! $to = $to ?: $this->hipChat->room()) {
            throw CouldNotSendNotification::missingTo();
        }

        try {
            $this->sendMessage($to, $message);
        } catch (ClientException $exception) {
            throw CouldNotSendNotification::hipChatRespondedWithAnError($exception);
        } catch (Exception $exception) {
            throw CouldNotSendNotification::internalError($exception);
        }
    }
1292562
public function send($notifiable, Notification $notification)
    {
        $this->changeTwitterSettingsIfNeeded($notifiable);

        $twitterMessage = $notification->toTwitter($notifiable);
        $twitterMessage = $this->addImagesIfGiven($twitterMessage);

        $this->twitter->post($twitterMessage->getApiEndpoint(), $twitterMessage->getRequestBody($this->twitter),
            $twitterMessage->isJsonRequest);

        if ($this->twitter->getLastHttpCode() !== 200) {
            throw CouldNotSendNotification::serviceRespondsNotSuccessful($this->twitter->getLastBody());
        }
    }
90394
public function toMail($notifiable)
    {
        return (new MailMessage)
            ->error()
            ->subject($this->getSubject())
            ->line($this->getMessageText());
    }
966935
public function send($notifiables, $notification)
    {
        return (new NotificationSender(
            $this, $this->app->make(Bus::class), $this->app->make(Dispatcher::class), $this->locale)
        )->send($notifiables, $notification);
    }
1134840
protected function messageBuilder($notifiable, $notification, $message)
    {
        return function ($mailMessage) use ($notifiable, $notification, $message) {
            $this->buildMessage($mailMessage, $notifiable, $notification, $message);
        };
    }
1348331
protected function getData($notifiable, Notification $notification)
    {
        if (method_exists($notification, 'toDatabase')) {
            $data = $notification->toDatabase($notifiable);

            return is_array($data) ? $data : $data->data;
        } elseif (method_exists($notification, 'toArray')) {
            return $notification->toArray($notifiable);
        }

        throw new RuntimeException(
            'Notification is missing toDatabase / toArray method.'
        );
    }
85643
public function toMail($notifiable): MailMessage
    {
        if (static::$toMailCallback) {
            return call_user_func(static::$toMailCallback, $notifiable);
        }

        $email = $notifiable->getEmailForVerification();
        $link = route('managerarea.verification.email.verify')."?email={$email}&expiration={$this->expiration}&token={$this->token}";

        return (new MailMessage())
            ->subject(trans('cortex/auth::emails.verification.email.subject'))
            ->line(trans('cortex/auth::emails.verification.email.intro', ['expire' => now()->createFromTimestamp($this->expiration)->diffForHumans()]))
            ->action(trans('cortex/auth::emails.verification.email.action'), $link)
            ->line(trans('cortex/auth::emails.verification.email.outro', ['created_at' => now(), 'ip' => request()->ip(), 'agent' => request()->userAgent()]));
    }