58ca4e68db
- Go backend API with full CRUD for all modules (CRM, Sales, Finance, HR, Legal, Marketing, Support, Purchase, Inventory, Projects, Automation, Analytics) - Rust analytics service with parallel report generation - C runtime with POSIX shared memory IPC - PostgreSQL schema with 30+ tables, full migrations - Redis cache, sessions, pub/sub - Kafka event streaming with Zookeeper - WebSocket hub for real-time updates - Automation engine with cron jobs, workflows, event triggers - JWT authentication, multi-tenant from start - Docker Compose with all services - Nginx reverse proxy with rate limiting - Integration tests passing - Feature gap analysis against Fortnox/Odoo/Visma Refs: BOC-001
59 lines
1.8 KiB
PHP
59 lines
1.8 KiB
PHP
<?php
|
|
/**
|
|
* Simple registration notification endpoint
|
|
* Sends email to hello@quixzoom.com when someone registers
|
|
*/
|
|
|
|
header('Content-Type: application/json');
|
|
header('Access-Control-Allow-Origin: *');
|
|
header('Access-Control-Allow-Methods: POST');
|
|
header('Access-Control-Allow-Headers: Content-Type');
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
|
http_response_code(200);
|
|
exit;
|
|
}
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
|
http_response_code(405);
|
|
echo json_encode(['error' => 'Method not allowed']);
|
|
exit;
|
|
}
|
|
|
|
$data = json_decode(file_get_contents('php://input'), true);
|
|
|
|
if (!$data || !isset($data['phone'])) {
|
|
http_response_code(400);
|
|
echo json_encode(['error' => 'Phone number required']);
|
|
exit;
|
|
}
|
|
|
|
$phone = htmlspecialchars($data['phone']);
|
|
$country = htmlspecialchars($data['country'] ?? 'Unknown');
|
|
$lang = htmlspecialchars($data['lang'] ?? 'en');
|
|
$source = htmlspecialchars($data['source'] ?? 'unknown');
|
|
|
|
$to = 'hello@quixzoom.com';
|
|
$subject = 'New Zoomer Registration: ' . $phone;
|
|
$message = "New Zoomer Registration\n\n";
|
|
$message .= "Phone: " . $phone . "\n";
|
|
$message .= "Country: " . $country . "\n";
|
|
$message .= "Language: " . $lang . "\n";
|
|
$message .= "Source: " . $source . "\n";
|
|
$message .= "Time: " . date('Y-m-d H:i:s') . " UTC\n";
|
|
$message .= "User Agent: " . ($_SERVER['HTTP_USER_AGENT'] ?? 'Unknown') . "\n";
|
|
$message .= "IP: " . ($_SERVER['REMOTE_ADDR'] ?? 'Unknown') . "\n";
|
|
|
|
$headers = 'From: noreply@quixzoom.com' . "\r\n";
|
|
$headers .= 'Reply-To: hello@quixzoom.com' . "\r\n";
|
|
$headers .= 'X-Mailer: PHP/' . phpversion();
|
|
|
|
$success = mail($to, $subject, $message, $headers);
|
|
|
|
if ($success) {
|
|
echo json_encode(['success' => true, 'message' => 'Notification sent']);
|
|
} else {
|
|
http_response_code(500);
|
|
echo json_encode(['error' => 'Failed to send notification']);
|
|
}
|