<?php
/*
Optional email notification sample.
Use only after configuring SMTP or server mail() properly.
This is not active by default.
*/
declare(strict_types=1);
header('Content-Type: application/json; charset=utf-8');
$raw = file_get_contents('php://input');
$payload = json_decode($raw, true);
$to = 'info@colorjet.com.bd';
$subject = 'New COLORJET Website Lead';
$message = print_r($payload, true);
$headers = "From: website@colorjetbd.com\r\n";
$sent = mail($to, $subject, $message, $headers);
echo json_encode(['ok' => $sent]);
