From 4f096047b6d8b32254c58ecebf95de8595d28b68 Mon Sep 17 00:00:00 2001 From: Myron Blair Date: Fri, 29 May 2026 18:58:35 +0000 Subject: [PATCH] Fix CyberMail payload format: use flat string for from/to fields --- includes/email.php | 4 ++-- includes/functions.php | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/includes/email.php b/includes/email.php index e1da4cc..0383bd2 100644 --- a/includes/email.php +++ b/includes/email.php @@ -58,8 +58,8 @@ class Email { public function send(string $to, string $subject, string $html, ?string $text = null, array $options = []): array { $payload = array_merge([ - 'from' => ['email' => $this->fromEmail, 'name' => getSetting('cybermail_from_name', "Tom's Java Jive")], - 'to' => [['email' => $to]], + 'from' => $this->fromEmail, + 'to' => $to, 'subject' => $subject, 'html' => $html, ], $options); diff --git a/includes/functions.php b/includes/functions.php index 17330a2..68b277d 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -336,8 +336,7 @@ function sendEmail($to, $subject, $htmlContent, $textContent = '') { error_log('[TJJ sendEmail] CYBERMAIL_API_KEY not configured'); return false; } - $payload = ['from' => ['email' => $from, 'name' => $fromName], - 'to' => [['email' => $to]], 'subject' => $subject, 'html' => $htmlContent]; + $payload = ['from' => $from, '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, [