<?php
$api_key = getenv('RESEND_API_KEY');
$payload = json_encode([
    'from'    => 'Floor It Website <noreply@floorithardwoodfloors.com>',
    'to'      => ['acobham@arisingmedia.us'],
    'subject' => 'Resend domain test',
    'text'    => 'Test send to verify domain',
]);
$ch = curl_init('https://api.resend.com/emails');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_POSTFIELDS     => $payload,
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer ' . $api_key,
        'Content-Type: application/json',
    ],
    CURLOPT_TIMEOUT => 10,
]);
$resp = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo "HTTP: $code\nBody: $resp\n";
