mirror of
https://github.com/myronblair/tomsjavajive
synced 2026-06-30 17:50:32 -05:00
Fix CyberMail from field — use separate from/from_name fields (API rejects Name <email> format)
This commit is contained in:
+2
-1
@@ -60,7 +60,8 @@ class Email {
|
|||||||
// Strip internal-only keys that are not CyberMail API fields
|
// Strip internal-only keys that are not CyberMail API fields
|
||||||
$apiOptions = array_diff_key($options, array_flip(['metadata']));
|
$apiOptions = array_diff_key($options, array_flip(['metadata']));
|
||||||
$payload = array_merge([
|
$payload = array_merge([
|
||||||
'from' => $this->fromName . ' <' . $this->fromEmail . '>',
|
'from' => $this->fromEmail,
|
||||||
|
'from_name' => $this->fromName,
|
||||||
'to' => $to,
|
'to' => $to,
|
||||||
'subject' => $subject,
|
'subject' => $subject,
|
||||||
'html' => $html,
|
'html' => $html,
|
||||||
|
|||||||
@@ -336,7 +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' => $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;
|
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, [
|
||||||
|
|||||||
Reference in New Issue
Block a user