PNG IHDR x sBIT|d pHYs + tEXtSoftware www.inkscape.org< ,tEXtComment
<?php
namespace App\Mail;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class WelcomeEmail extends Mailable
{
use Queueable, SerializesModels;
public $user;
/**
* Create a new message instance.
*/
public function __construct(User $user)
{
$this->user = $user;
}
/**
* Build the message.
*/
public function build()
{
$name = $this->user->name;
$email = $this->user->email;
$uuid = $this->user->uuid;
$companyName = setting('company_name', config('app.name'));
$dashboardUrl = route('dashboard');
$supportEmail = setting('company_email', 'support@example.com');
// Defensive: Ensure all required variables are present
if (empty($name) || empty($email) || empty($uuid) || empty($companyName) || empty($dashboardUrl) || empty($supportEmail)) {
$missing = [];
if (empty($name)) $missing[] = 'name';
if (empty($email)) $missing[] = 'email';
if (empty($uuid)) $missing[] = 'uuid';
if (empty($companyName)) $missing[] = 'companyName';
if (empty($dashboardUrl)) $missing[] = 'dashboardUrl';
if (empty($supportEmail)) $missing[] = 'supportEmail';
\Log::error('WelcomeEmail not sent: missing required data', [
'missing' => $missing,
'name' => $name,
'email' => $email,
'uuid' => $uuid,
'companyName' => $companyName,
'dashboardUrl' => $dashboardUrl,
'supportEmail' => $supportEmail
]);
throw new \InvalidArgumentException('WelcomeEmail cannot be sent: missing required data: ' . implode(', ', $missing));
}
return $this->subject('Welcome to ' . $companyName)
->markdown('emails.welcome')
->with([
'name' => $name,
'email' => $email,
'uuid' => $uuid,
'companyName' => $companyName,
'dashboardUrl' => $dashboardUrl,
'supportEmail' => $supportEmail
]);
}
}
b IDATxytVսϓ22 A@IR:hCiZ[v*E:WũZA ^dQeQ @ !jZ'>gsV仿$|?g)&x-E