mirror of
https://github.com/myronblair/parkerslingshotrentals
synced 2026-06-30 17:50:31 -05:00
Switch email to CyberMail API (orbishosting.com domain)
This commit is contained in:
@@ -10,8 +10,8 @@ define('ADMIN_USER', 'admin');
|
||||
define('ADMIN_PASS', '$2y$10$ynnk3RfarOD7VIJizC30kuXqu6tQ3gotNrlp5y33afh5fPOgnAMU6'); // Parker2026!
|
||||
define('ADMIN_SESSION_KEY', 'parker_admin_auth');
|
||||
|
||||
define('SENDGRID_API_KEY', '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');
|
||||
define('MAIL_FROM', 'noreply@parkerslingshotrentals.com');
|
||||
define('CYBERMAIL_API_KEY', 'sk_live_d52bf062797105aeaafac9954c21ff988e9b41b77315807d');
|
||||
define('MAIL_FROM', 'noreply@orbishosting.com');
|
||||
define('MAIL_FROM_NAME', 'Parker County Slingshot Rentals');
|
||||
define('ADMIN_EMAIL', 'info@parkerslingshotrentals.com');
|
||||
|
||||
@@ -62,21 +62,28 @@ function generateRef(): string {
|
||||
}
|
||||
|
||||
function sendEmail(string $to, string $toName, string $subject, string $html): bool {
|
||||
if (!SENDGRID_API_KEY || strpos(SENDGRID_API_KEY, 'YOUR_KEY') !== false) return false;
|
||||
$apiKey = defined('CYBERMAIL_API_KEY') ? CYBERMAIL_API_KEY : '';
|
||||
if (!$apiKey || strpos($apiKey, 'YOUR_KEY') !== false) return false;
|
||||
$payload = json_encode([
|
||||
'personalizations' => [['to' => [['email' => $to, 'name' => $toName]]]],
|
||||
'from' => ['email' => MAIL_FROM, 'name' => MAIL_FROM_NAME],
|
||||
'to' => [['email' => $to, 'name' => $toName]],
|
||||
'subject' => $subject,
|
||||
'content' => [['type' => 'text/html', 'value' => $html]],
|
||||
'html' => $html,
|
||||
]);
|
||||
$ch = curl_init('https://api.sendgrid.com/v3/mail/send');
|
||||
$ch = curl_init('https://platform.cyberpersons.com/email/v1/send');
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true,
|
||||
CURLOPT_POSTFIELDS => $payload,
|
||||
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . SENDGRID_API_KEY, 'Content-Type: application/json'],
|
||||
CURLOPT_TIMEOUT => 15, CURLOPT_SSL_VERIFYPEER => false,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_POST => true,
|
||||
CURLOPT_POSTFIELDS => $payload,
|
||||
CURLOPT_HTTPHEADER => [
|
||||
'Authorization: Bearer ' . $apiKey,
|
||||
'Content-Type: application/json',
|
||||
],
|
||||
CURLOPT_TIMEOUT => 15,
|
||||
CURLOPT_SSL_VERIFYPEER => false,
|
||||
]);
|
||||
$resp = curl_exec($ch);
|
||||
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_exec($ch); curl_close($ch);
|
||||
curl_close($ch);
|
||||
return $code === 202;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user