From 602bc77cdd9fea32f89adeae160ec69a2a75d838 Mon Sep 17 00:00:00 2001 From: Myron Blair Date: Sun, 14 Jun 2026 15:40:35 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20CyberMail=20from=20field=20=E2=80=94=20us?= =?UTF-8?q?e=20separate=20from/from=5Fname=20fields=20(API=20rejects=20Nam?= =?UTF-8?q?e=20=20format)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- includes/email.php | 3 ++- includes/functions.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/email.php b/includes/email.php index e85bb6d..cc76a26 100644 --- a/includes/email.php +++ b/includes/email.php @@ -60,7 +60,8 @@ class Email { // Strip internal-only keys that are not CyberMail API fields $apiOptions = array_diff_key($options, array_flip(['metadata'])); $payload = array_merge([ - 'from' => $this->fromName . ' <' . $this->fromEmail . '>', + 'from' => $this->fromEmail, + 'from_name' => $this->fromName, 'to' => $to, 'subject' => $subject, 'html' => $html, diff --git a/includes/functions.php b/includes/functions.php index 86019c4..936c2a3 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -336,7 +336,7 @@ function sendEmail($to, $subject, $htmlContent, $textContent = '') { error_log('[TJJ sendEmail] CYBERMAIL_API_KEY not configured'); return false; } - $payload = ['from' => $fromName . ' <' . $from . '>', 'to' => $to, 'subject' => $subject, 'html' => $htmlContent]; + $payload = ['from' => $from, 'from_name' => $fromName, 'to' => $to, 'subject' => $subject, 'html' => $htmlContent]; if ($textContent) $payload['text'] = $textContent; $ch = curl_init('https://platform.cyberpersons.com/email/v1/send'); curl_setopt_array($ch, [