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

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use App\Lib\EmailSetupHelper;

class EditRequest extends Mailable
{
    use Queueable, SerializesModels;
    const KEY_TO_ADMIN = "abstract_edit_request_send_admin";
    protected $data;
    protected $emailSetup;
    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($data)
    {
        $this->data = $data;
        $this->emailSetup =  new EmailSetupHelper();
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {

        //Get the email configurations using key and event id
        $emailContents = $this->emailSetup->getEmailData($this->data['event_id'],self::KEY_TO_ADMIN);
        $abstractViewLink = $this->emailSetup->formatLinks($emailContents->body,'abstract_view_link_title',$this->data['abstract_url']);
        $variables=[
            'event_name' => $this->data['event_name'],
            'submitter_name' => $this->data['submitter_name'],
            'abstract_view_link' => $abstractViewLink,
            'abstract_id' => $this->data['abstract_id']
        ];
        $subject = $this->emailSetup->formatEmailBody($emailContents->subject,$variables);
        $body = $this->emailSetup->formatEmailBody($emailContents->body,$variables);
        $body = html_entity_decode($this->emailSetup->removeLinkTitleFromBody($body,'abstract_view_link_title'));

        $logo = config('app.url') . '/' . $this->data['logo'];

        // $body = "
        //  <p>
        //       Hi {$this->data['event_name']} Admin,<br/><br>
        //       An edit request has been sent by {$this->data['submitter_name']}
        //       <br><br>
        //       Please click the link below to view the abstract and take necessary action.<br><br>

        //       <strong>Details</strong><br>
        //       Event       : {$this->data['event_name']}<br>
        //       Link        : <a href='{$this->data['abstract_url']}'>{$this->data['abstract_url']}</a><br>
        //       Abstract Id : {$this->data['abstract_id']}<br><br>

        //       Thank you,<br>
        //       {$this->data['event_name']} Team<br>
        // </p>
        // ";

        return $this->from(config('app.admin_mail', 'Admin'), $this->data['event_name'])
            ->subject($subject)
            ->view('emails.admin.edit_request')
            ->with([
                "body" => $body,
                "event_header" => $this->data['event_name'],
                "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).