File: /var/www/html/sarvodayahospital/app/Mail/NeedHelpFormSubmit.php
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class NeedHelpFormSubmit extends Mailable implements ShouldQueue
{
use Queueable, SerializesModels;
public $objMail;
public function __construct($objMail)
{
$this->objMail = $objMail;
}
public function build()
{
$name = config('mail.from.name');
$addressFrom = config('mail.from.address');
$subject = $this->objMail->SubjectLine ?? 'Need Help';
$mailInfo = $this->markdown('mail.need-help-form-submit')
->from($addressFrom, $name)
->subject($subject)
->with(['contact' => $this->objMail]);
if ($this->objMail->AttachmentURL) {
$mailInfo->attachFromStorageDisk('s3', $this->objMail->AttachmentURL);
}
return $mailInfo;
}
}