HTML EMAIL TEMPLATE USAGE GUIDE
================================

File: email-leave-relief.html

This is a standalone HTML email template with placeholders that you can replace
with actual values when sending emails.

PLACEHOLDERS TO REPLACE:
-------------------------
{{LOGO_URL}}                    - URL to your logo image
{{RELIEF_STAFF_NAME}}           - Full name of the relief staff member
{{APPLICANT_NAME}}              - Full name of the staff requesting leave
{{APPLICANT_JOB_TITLE}}         - Job title of the applicant
{{APPLICANT_BRANCH}}            - Branch location
{{APPLICANT_STATE}}             - State location (include ", " before if needed)
{{LEAVE_TYPE}}                  - Type of leave (e.g., "Annual Leave", "Sick Leave")
{{DATE_FROM}}                   - Start date (e.g., "15 Jan 2024")
{{DATE_TO}}                     - End date (e.g., "20 Jan 2024")
{{NUMBER_OF_DAYS}}              - Number of days (e.g., "5")
{{DAYS_TEXT}}                   - "Day" or "Days" (singular/plural)
{{APPLICATION_TOKEN}}           - Application reference/token
{{NOTIFICATION_URL}}            - Direct link to the leave relief page
{{NOTIFICATIONS_URL}}           - Link to all notifications page
{{CURRENT_YEAR}}                - Current year (e.g., "2024")

OPTIONAL SECTION:
-----------------
{{ADDITIONAL_INFORMATION_SECTION}} - Replace with additional info section if needed
                                    If no additional info, remove this placeholder

EXAMPLE PHP USAGE:
------------------
// Read the template
$template = file_get_contents('email-leave-relief.html');

// Replace placeholders
$template = str_replace('{{LOGO_URL}}', 'https://yoursite.com/images/email-logo.png', $template);
$template = str_replace('{{RELIEF_STAFF_NAME}}', 'John Doe', $template);
$template = str_replace('{{APPLICANT_NAME}}', 'Jane Smith', $template);
$template = str_replace('{{APPLICANT_JOB_TITLE}}', 'Senior Manager', $template);
$template = str_replace('{{APPLICANT_BRANCH}}', 'Lagos Branch', $template);
$template = str_replace('{{APPLICANT_STATE}}', ', Lagos State', $template);
$template = str_replace('{{LEAVE_TYPE}}', 'Annual Leave', $template);
$template = str_replace('{{DATE_FROM}}', '15 Jan 2024', $template);
$template = str_replace('{{DATE_TO}}', '20 Jan 2024', $template);
$template = str_replace('{{NUMBER_OF_DAYS}}', '5', $template);
$template = str_replace('{{DAYS_TEXT}}', 'Days', $template);
$template = str_replace('{{APPLICATION_TOKEN}}', 'APP-2024-001', $template);
$template = str_replace('{{NOTIFICATION_URL}}', 'https://yoursite.com/staff/leave-relief?application_id=APP-2024-001', $template);
$template = str_replace('{{NOTIFICATIONS_URL}}', 'https://yoursite.com/staff/notifications', $template);
$template = str_replace('{{CURRENT_YEAR}}', date('Y'), $template);

// Handle additional information (optional)
if(!empty($additional_information)) {
    $additional_section = '
                                                        <tr>
                                                            <td colspan="2" style="padding-top: 15px; padding-bottom: 5px;">
                                                                <p style="margin: 0; color: #666666; font-size: 14px; font-weight: 600;">Additional Information:</p>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td colspan="2" style="padding: 10px 0;">
                                                                <p style="margin: 0; color: #333333; font-size: 14px; line-height: 1.6; white-space: pre-wrap;">' . nl2br(htmlspecialchars($additional_information)) . '</p>
                                                            </td>
                                                        </tr>';
    $template = str_replace('{{ADDITIONAL_INFORMATION_SECTION}}', $additional_section, $template);
} else {
    $template = str_replace('{{ADDITIONAL_INFORMATION_SECTION}}', '', $template);
}

// Use with PHPMailer
$mail->Body = $template;
$mail->isHTML(true);

