fix(email): use client/org name as From display, not Ladill product
Deploy Ladill Meet / deploy (push) Successful in 1m33s
Deploy Ladill Meet / deploy (push) Successful in 1m33s
Customer-facing outbound mail should appear from the business (organizer, clinic, company, location), not the Ladill product brand.
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Mail;
|
|||||||
|
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Mail\Mailable;
|
use Illuminate\Mail\Mailable;
|
||||||
|
use Illuminate\Mail\Mailables\Address;
|
||||||
use Illuminate\Mail\Mailables\Content;
|
use Illuminate\Mail\Mailables\Content;
|
||||||
use Illuminate\Mail\Mailables\Envelope;
|
use Illuminate\Mail\Mailables\Envelope;
|
||||||
use Illuminate\Queue\SerializesModels;
|
use Illuminate\Queue\SerializesModels;
|
||||||
@@ -23,7 +24,13 @@ class ContactMessageMail extends Mailable
|
|||||||
|
|
||||||
public function envelope(): Envelope
|
public function envelope(): Envelope
|
||||||
{
|
{
|
||||||
|
$display = trim((string) ($this->fromName ?: $this->companyName));
|
||||||
|
$fromAddress = (string) config('mail.from.address');
|
||||||
|
|
||||||
return new Envelope(
|
return new Envelope(
|
||||||
|
from: $display !== '' && $fromAddress !== ''
|
||||||
|
? new Address($fromAddress, $display)
|
||||||
|
: null,
|
||||||
subject: $this->subjectLine,
|
subject: $this->subjectLine,
|
||||||
replyTo: $this->replyToAddress ? [$this->replyToAddress] : [],
|
replyTo: $this->replyToAddress ? [$this->replyToAddress] : [],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -27,9 +27,11 @@ class EmailService
|
|||||||
$logoUrl = OrganizationBranding::emailLogoUrl($organization);
|
$logoUrl = OrganizationBranding::emailLogoUrl($organization);
|
||||||
$companyName = $organization->name;
|
$companyName = $organization->name;
|
||||||
}
|
}
|
||||||
|
// Client-facing From display: org/company name, never the Ladill product brand.
|
||||||
|
$displayName = trim((string) ($fromName ?: $companyName)) ?: null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Mail::to($to)->send(new ContactMessageMail($subject, $body, $fromName, $replyTo, $logoUrl, $companyName));
|
Mail::to($to)->send(new ContactMessageMail($subject, $body, $displayName, $replyTo, $logoUrl, $companyName));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
|
|||||||
@@ -135,8 +135,11 @@ class MeetNotificationService
|
|||||||
? $room->scheduled_at->timezone($room->timezone)->format('M j, Y g:i A T')
|
? $room->scheduled_at->timezone($room->timezone)->format('M j, Y g:i A T')
|
||||||
: 'Instant meeting';
|
: 'Instant meeting';
|
||||||
|
|
||||||
|
$orgName = trim((string) ($room->organization?->name ?? ''));
|
||||||
|
$sessionLabel = $orgName !== '' ? $orgName.' meeting' : 'video meeting';
|
||||||
|
|
||||||
$lines = [
|
$lines = [
|
||||||
$host->name.' invited you to a Ladill Meet session.',
|
$host->name.' invited you to a '.$sessionLabel.'.',
|
||||||
'',
|
'',
|
||||||
'Meeting: '.$room->title,
|
'Meeting: '.$room->title,
|
||||||
'When: '.$when,
|
'When: '.$when,
|
||||||
|
|||||||
Reference in New Issue
Block a user