<?php
/**
 * Email Configuration
 * Simple email configuration for the ticketing system
 */

// Email configuration
define('SMTP_HOST', 'smtp.gmail.com');
define('SMTP_PORT', 587);
define('SMTP_PORT_ALT', 465); // Alternative port for SSL/TLS
define('SMTP_USERNAME', 'ahoststore1@gmail.com');
define('SMTP_PASSWORD', 'qwjr gmtr imdx uqlq');
define('SMTP_ENCRYPTION', 'tls'); // tls or ssl

// Email addresses
define('SUPPORT_EMAIL', 'support@storeweb.com');
define('NO_REPLY_EMAIL', 'no-reply@storeweb.com');

// Email templates
function getTicketCreatedEmailTemplate($ticket_id, $subject, $customer_name) {
    $template = "
    <html>
    <body>
        <h2>New Support Ticket Created</h2>
        <p>Hello {$customer_name},</p>
        <p>Thank you for contacting our support team. We have received your ticket and will respond as soon as possible.</p>
        <p><strong>Ticket Details:</strong></p>
        <ul>
            <li>Ticket ID: #{$ticket_id}</li>
            <li>Subject: {$subject}</li>
            <li>Status: New</li>
        </ul>
        <p>You can view your ticket at any time by logging into your account and visiting the support section.</p>
        <p>Thank you for your patience.</p>
        <p>Best regards,<br>The Support Team</p>
    </body>
    </html>
    ";
    return $template;
}

function getTicketStatusUpdatedEmailTemplate($ticket_id, $subject, $status, $customer_name) {
    $template = "
    <html>
    <body>
        <h2>Ticket Status Updated</h2>
        <p>Hello {$customer_name},</p>
        <p>The status of your support ticket has been updated.</p>
        <p><strong>Ticket Details:</strong></p>
        <ul>
            <li>Ticket ID: #{$ticket_id}</li>
            <li>Subject: {$subject}</li>
            <li>New Status: {$status}</li>
        </ul>
        <p>You can view your ticket at any time by logging into your account and visiting the support section.</p>
        <p>Thank you for your patience.</p>
        <p>Best regards,<br>The Support Team</p>
    </body>
    </html>
    ";
    return $template;
}

function getNewReplyEmailTemplate($ticket_id, $subject, $reply_author, $customer_name) {
    $template = "
    <html>
    <body>
        <h2>New Reply to Your Ticket</h2>
        <p>Hello {$customer_name},</p>
        <p>You have received a new reply to your support ticket from {$reply_author}.</p>
        <p><strong>Ticket Details:</strong></p>
        <ul>
            <li>Ticket ID: #{$ticket_id}</li>
            <li>Subject: {$subject}</li>
        </ul>
        <p>Please log in to your account to view the full reply and respond if needed.</p>
        <p>Thank you for your patience.</p>
        <p>Best regards,<br>The Support Team</p>
    </body>
    </html>
    ";
    return $template;
}
?>