mirror of
https://github.com/myronblair/tomsjavajive
synced 2026-06-30 17:50:32 -05:00
Fix remaining code review findings: email transport errors, metadata payload, from-name, pagination
- Email::send(): add curl_error() check so transport failures (timeout, DNS, TLS) return a diagnosable error string instead of Unknown error - Email::send(): strip metadata key from options before array_merge so non-API fields are never sent to CyberMail endpoint - Email::send() + sendEmail(): include from-name in From field using RFC 5322 "Name <email>" format so fromName DB setting takes effect - email-log.php: replace unbounded page-link loop with a windowed paginator (first/last 2 pages + ±2 around current) with ellipsis gaps — prevents hundreds of anchors rendering at scale
This commit is contained in:
@@ -336,7 +336,7 @@ function sendEmail($to, $subject, $htmlContent, $textContent = '') {
|
||||
error_log('[TJJ sendEmail] CYBERMAIL_API_KEY not configured');
|
||||
return false;
|
||||
}
|
||||
$payload = ['from' => $from, 'to' => $to, 'subject' => $subject, 'html' => $htmlContent];
|
||||
$payload = ['from' => $fromName . ' <' . $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, [
|
||||
|
||||
Reference in New Issue
Block a user