feat: add Backend mit allen aktuellen features + Demo Daten
This commit is contained in:
1 parent
a78e84515a
commit
e122aa8650
17 files changed
+704
-238
No files matched your search
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require __DIR__.'/../public/booking/backend.php';
|
||||
|
||||
$database = bookingDatabase();
|
||||
$result = bookingRunJobs($database);
|
||||
$transport = getenv('BOOKING_MAIL_TRANSPORT') ?: 'database';
|
||||
if ($transport === 'mail') {
|
||||
$outbox = $database->query('SELECT id, recipient_email, subject, body FROM sufw_booking_outbox WHERE sent_at IS NULL ORDER BY id');
|
||||
foreach ($outbox as $mail) {
|
||||
if (mail($mail['recipient_email'], $mail['subject'], $mail['body'])) {
|
||||
$database->prepare('UPDATE sufw_booking_outbox SET sent_at = UTC_TIMESTAMP() WHERE id = :id')->execute(['id' => $mail['id']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
echo json_encode($result, JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR).PHP_EOL;
|
||||
Reference in new issue
Block a user