PHP 7.4.33
Preview: AssignReviewerMail.php Size: 3.13 KB
/var/www/multi-event-cfp.bitkit.dk/httpdocs/app/Mail/AssignReviewerMail.php
<?php

namespace App\Mail;

use App\Models\PresentationReview;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
use App\Lib\EmailSetupHelper;

class AssignReviewerMail extends Mailable
{
    use Queueable, SerializesModels;


    protected $review;
    protected $emailSetup;
    const KEY_TO_REVIEWER = "presentation_reviewer_assign_reviewer";

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct(PresentationReview $review)
    {
        $this->review = $review;
        $this->presentation = $review->presentation;
        $this->emailSetup =  new EmailSetupHelper();
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        $emailContents = $this->emailSetup->getEmailData($this->presentation->event->id,self::KEY_TO_REVIEWER);

        $logo = config('app.url') . '/' . $this->presentation->event->theme['logo']['value'];
        $eventHeader = $this->presentation->event->event_name;
        $eventUrl = $this->presentation->event->eventUrl('reviewer');
        $presentationUrl = $eventUrl . "presentation/{$this->presentation->id}";
        $presentationTitle = isset($this->presentation->data[0]) ? $this->presentation->data[0]['value'] : '';
        $presentationViewLink = $this->emailSetup->formatLinks($emailContents->body,'presentation_view_link_title',$presentationUrl);

        Log::info($eventUrl);
        Log::info($presentationUrl);
        $variables = [
            'reviewer_name' => $this->review->reviewer->name,
            'presentation_title' => $presentationTitle,
            'presentation_view_link' => $presentationViewLink,
            'event_name' => $this->presentation->event->event_name,
            'presentation_id' => $this->presentation->id,
            'abstract_id' => $this->presentation->abstract_id ? $this->presentation->abstract_id : ''
        ];

        $subject = $this->emailSetup->formatEmailBody($emailContents->subject,$variables);
        $body = $this->emailSetup->formatEmailBody($emailContents->body,$variables);
        $body = html_entity_decode($this->emailSetup->removeLinkTitleFromBody($body,'presentation_view_link_title'));

//         $body = "
//         <p>

// Dear {$this->review->reviewer->name},<br><br>

// As a member of {$this->presentation->event->event_name} Conference,
// it is now time to start reviewing the speaker presentations.<br>
// You have been added as a reviewer of presentation {$this->presentation->id}.<br>
// To review the presentation, please click here
// <a href={$presentationUrl}>{$presentationUrl}</a><br><br>

// Thank you,<br>

// {$this->presentation->event->event_name} Conference Team
//         ";

        return $this->from(config('app.admin_mail', 'Admin'), $this->presentation->event->event_name)
            ->subject($subject)
            ->view('emails.presentation.assign_reviewer')
            ->with([
                "body" => $body,
                "eventHeader" => $eventHeader,
                "logo" => $logo
            ]);
    }
}

Directory Contents

Dirs: 0 × Files: 34
Name Size Perms Modified Actions
3.36 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
2.72 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
4.57 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
3.92 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
5.26 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
3.02 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
4.96 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
1.93 KB lrw-rw-r-- 2025-03-03 05:40:15
Edit Download
3.13 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
1.92 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
2.62 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
2.12 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
1.18 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
558 B lrw-rw-r-- 2025-10-28 05:25:19
Edit Download
3.32 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
1.35 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
3.17 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
3.59 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
4.22 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
3.10 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
5.12 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
3.23 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
2.63 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
2.58 KB lrw-rw-r-- 2024-07-09 04:25:22
Edit Download
879 B lrw-r--r-- 2024-02-09 12:37:30
Edit Download
3.06 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
507 B lrw-r--r-- 2024-02-09 12:37:30
Edit Download
1.54 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
2.67 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
5.42 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
3.46 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
4.31 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
1.32 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
2.97 KB lrw-r--r-- 2024-02-09 12:37:30
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).