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, [