<?php

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

include_once __DIR__ . '/PHPMailer/PHProcksAutoloader.php';



$subject = "Neues Ticket - Feuerwehr Bad Zwischenahn";

$oMailer = new PHPMailer;
$oMailer->CharSet = 'UTF-8';

$erstellt = date("d.m.Y - H:i:s");
$text1 = <<<HTML
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Ticket-Status geändert</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            padding: 20px;
        }
        .container {
            max-width: 600px;
            margin: 0 auto;
            background: #ffffff;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        .header {
            background: #007bff;
            color: #ffffff;
            padding: 15px;
            text-align: center;
            font-size: 20px;
            font-weight: bold;
            border-radius: 10px 10px 0 0;
        }
        .content {
            padding: 20px;
            font-size: 16px;
            color: #333333;
        }
        .footer {
            margin-top: 20px;
            font-size: 14px;
            color: #777777;
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">Ticketstatus geändert</div>
        <div class="content">
            <p>Moin Kamerad/in,</p>
            <p>der Status deines Tickets hat sich geändert. Hier sind die aktuellen Informationen:</p>
            <p><strong>Ticketnummer:</strong> {TICKET_ID}</p>
            <p><strong>Neuer Status:</strong> {TICKET_STATUS}</p>
            <p>Falls du weitere Fragen hast, melde dich gerne bei uns.</p>
            <p>Mit kameradschaftlichen Grüßen,<br>Dein Support-Team</p>
        </div>
        <div class="footer">
            &copy; Feuerwehr Bad Zwischenahn
        </div>
    </div>
</body>
</html>
HTML;


$oMailer->isSMTP();
$oMailer->Host = 'mail.f-invent.de';
$oMailer->SMTPAuth = true;
$oMailer->Username = 'noreply@f-invent.de';
$oMailer->Password = 'b*Y!@Ys.aKS^';
$oMailer->SMTPSecure = 'tls';
$oMailer->Port = 587;

$oMailer->From = 'noreply@f-invent.de';
$oMailer->FromName = 'Ticketsystem';
$oMailer->addBCC('ticketsystem@feuerwehr-bad-zwischenahn.de');
$oMailer->addAddress('nils.bonk@me.com');
$oMailer->addReplyTo('ticketsystem@feuerwehr-bad-zwischenahn.de');

$oMailer->isHTML( true );
$oMailer->Subject = $subject;
$oMailer->Body = $text1;

$oMailer->AltBody = strip_tags( $oMailer->Body );


if ( !$oMailer->send() ) {

    echo 'Something\'s went wrong!';
    exit;

}

//echo 'Yes! First Mail with PHPMailer sent successfully!';

 ?>
