HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/zuiderbos.komma.pro/app/Komma/Mailers/Mailer.php
<?php

namespace Komma\Mailers;

use Illuminate\Support\Facades\Mail;

class Mailer
{
    //class that never will be used on it's own
    /**
     * This is an wrapper for the Mail facade
     * and will sent an email with a view.
     *
     * @param $to | Address to send to
     * @param $subject | Subject of the email
     * @param $view | The view that is send
     * @param array $data
     */
    public function sendTo($to, $subject, $view, $data = [], $cc = [])
    {
        /**
         * Send a new message using a view.
         *
         * @param string|array $view
         * @param array $data
         * @param \Closure|string $callback calls callMessageBuilder
         * @return void
         */
        Mail::send($view, $data, function ($message) use ($to, $subject, $data, $cc) {
            //Set the mail to
            $message->to($to);
            if (count($cc) != 0) {
                $message->cc($cc);
            }
            //Set the subject
            $message = $message->subject($subject);
            //If replyTo is set, set this in the header
            if (isset($data['replyTo'])) {
                $message = $message->replyTo($data['replyTo'], $data['replyTo']);
            }
        });
    }
}