fix(care): use clinic name as email From display, not Ladill Care
Deploy Ladill Care / deploy (push) Successful in 28s
Deploy Ladill Care / deploy (push) Successful in 28s
Patient-facing suite (and Bird fallback) emails should appear from the organization name. Stop defaulting from_name to CARE_SMTP_FROM_NAME. Appointment notifications also prefer suite messaging with the same rule.
This commit is contained in:
@@ -42,13 +42,22 @@ class PatientMessageController extends Controller
|
||||
$owner = $this->ownerRef($request);
|
||||
$organization = $this->organization($request);
|
||||
$html = OrganizationBranding::wrapEmailHtml(nl2br(e($data['body'])), $organization);
|
||||
// Patient-facing From display name is the clinic/company, never the Ladill product.
|
||||
$fromName = trim((string) $organization->name) ?: null;
|
||||
|
||||
$sent = false;
|
||||
$error = null;
|
||||
$via = null;
|
||||
|
||||
if ($platformEmail->isConfigured()) {
|
||||
$sent = $platformEmail->send($owner, (string) $patient->email, $data['subject'], $html, $data['body']);
|
||||
$sent = $platformEmail->send(
|
||||
$owner,
|
||||
(string) $patient->email,
|
||||
$data['subject'],
|
||||
$html,
|
||||
$data['body'],
|
||||
$fromName,
|
||||
);
|
||||
$via = 'suite';
|
||||
if (! $sent) {
|
||||
$error = $platformEmail->lastError();
|
||||
@@ -61,7 +70,7 @@ class PatientMessageController extends Controller
|
||||
$sent = $email->send(
|
||||
$apiKey,
|
||||
(string) $credential->bird_from_email,
|
||||
$credential->bird_from_name,
|
||||
$credential->bird_from_name ?: $fromName,
|
||||
(string) $patient->email,
|
||||
$data['subject'],
|
||||
$html,
|
||||
|
||||
Reference in New Issue
Block a user