<?php

namespace App\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Contracts\Mail\Mailer;

class SendTestEmail implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle(Mailer $mailer)
    {
        $emails = [
            'kwesi@click-mobile.com', 
            'kwesi_banson@hotmail.com',
            'mansa@click-mobile.com',
            'diana@click-mobile.com'
        ];
        $data = [];
        $mailer->send('emails.test', $data, function ($message) use ($data, $emails) {
            $message->from('alerts@click-mobile.com', 'Click Mobile ERP');
            $message->to($emails)->subject('Short Code Invoices');
        });
    }
}
