Fix CyberMail payload format: use flat string for from/to fields

This commit is contained in:
2026-05-29 18:58:35 +00:00
parent 76bf967bd0
commit 4f096047b6
2 changed files with 3 additions and 4 deletions
+2 -2
View File
@@ -58,8 +58,8 @@ class Email {
public function send(string $to, string $subject, string $html, ?string $text = null, array $options = []): array { public function send(string $to, string $subject, string $html, ?string $text = null, array $options = []): array {
$payload = array_merge([ $payload = array_merge([
'from' => ['email' => $this->fromEmail, 'name' => getSetting('cybermail_from_name', "Tom's Java Jive")], 'from' => $this->fromEmail,
'to' => [['email' => $to]], 'to' => $to,
'subject' => $subject, 'subject' => $subject,
'html' => $html, 'html' => $html,
], $options); ], $options);
+1 -2
View File
@@ -336,8 +336,7 @@ function sendEmail($to, $subject, $htmlContent, $textContent = '') {
error_log('[TJJ sendEmail] CYBERMAIL_API_KEY not configured'); error_log('[TJJ sendEmail] CYBERMAIL_API_KEY not configured');
return false; return false;
} }
$payload = ['from' => ['email' => $from, 'name' => $fromName], $payload = ['from' => $from, 'to' => $to, 'subject' => $subject, 'html' => $htmlContent];
'to' => [['email' => $to]], 'subject' => $subject, 'html' => $htmlContent];
if ($textContent) $payload['text'] = $textContent; if ($textContent) $payload['text'] = $textContent;
$ch = curl_init('https://platform.cyberpersons.com/email/v1/send'); $ch = curl_init('https://platform.cyberpersons.com/email/v1/send');
curl_setopt_array($ch, [ curl_setopt_array($ch, [