Files
ladill-frontdesk/app/Mail/ContactMessageMail.php
T
isaacclad 9c14d4db3b
Deploy Ladill Frontdesk / deploy (push) Successful in 55s
fix(email): use client/org name as From display, not Ladill product
Customer-facing outbound mail should appear from the business (organizer,
clinic, company, location), not the Ladill product brand.
2026-07-16 12:01:10 +00:00

52 lines
1.4 KiB
PHP

<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Address;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class ContactMessageMail extends Mailable
{
use Queueable, SerializesModels;
public function __construct(
public string $subjectLine,
public string $bodyText,
public ?string $fromName = null,
public ?string $replyToAddress = null,
public ?string $logoUrl = null,
public ?string $companyName = null,
) {}
public function envelope(): Envelope
{
$display = trim((string) ($this->fromName ?: $this->companyName));
$fromAddress = (string) config('mail.from.address');
return new Envelope(
from: $display !== '' && $fromAddress !== ''
? new Address($fromAddress, $display)
: null,
subject: $this->subjectLine,
replyTo: $this->replyToAddress ? [$this->replyToAddress] : [],
);
}
public function content(): Content
{
return new Content(
view: 'email.contact-message',
with: [
'bodyText' => $this->bodyText,
'fromName' => $this->fromName,
'logoUrl' => $this->logoUrl,
'companyName' => $this->companyName,
],
);
}
}