<?php

/**
 * The template for displaying payment receipt
 *
 * This template can be overridden by copying it to yourtheme/movie-engine/emails/receipt.php.
 *
 * HOWEVER, on occasion MovieEngine will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of the template file will be bumped and
 * the readme will list any important changes.
 *
 * NOTE: Inline styles in email templates are intentional for email client compatibility.
 *
 * @note Please do not delete our CSS classes when you customize, as it may break functionality.
 * @package Movie_Engine
 * @subpackage Movie_Engine/templates
 * @version 1.0.0
 * @since 1.0.0
 */

if (! defined("ABSPATH")) {
    exit; // Exit if accessed directly
}
?>

<h1><?php esc_html_e('Hi', 'cine-movie-engine'); ?> {user_name},</h1>
<p><?php esc_html_e('Thank you for your purchase! Your payment has been successfully processed and your content is now available.', 'cine-movie-engine'); ?></p>
<div class="divider"></div>
<table class="meta-table">
    <tr>
        <td><?php esc_html_e('Item Purchased', 'cine-movie-engine'); ?></td>
        <td class="val">{item_name}</td>
    </tr>
    <tr>
        <td><?php esc_html_e('Amount Paid', 'cine-movie-engine'); ?></td>
        <td class="val">{amount}</td>
    </tr>
    <tr>
        <td><?php esc_html_e('Transaction ID', 'cine-movie-engine'); ?></td>
        <td class="val" style="word-break: break-all; word-wrap: break-word;"><code>{transaction_id}</code></td>
    </tr>
    <tr>
        <td><?php esc_html_e('Date', 'cine-movie-engine'); ?></td>
        <td class="val">{date}</td>
    </tr>
</table>
<?php
$movie_engine_email_options = get_option('movie_engine_email_settings', []);
$movie_engine_email_primary_color = !empty($movie_engine_email_options['primary_color']) ? $movie_engine_email_options['primary_color'] : '#E50914';
$movie_engine_email_btn_text_color = !empty($movie_engine_email_options['btn_text_color']) ? $movie_engine_email_options['btn_text_color'] : '#FFFFFF';
?>
<div style="text-align: center;">
    <a href="{watch_url}" class="btn" style="background-color: <?php echo esc_attr($movie_engine_email_primary_color); ?>; color: <?php echo esc_attr($movie_engine_email_btn_text_color); ?>; text-decoration: none; padding: 12px 30px; border-radius: 4px; font-weight: bold; display: inline-block;"><?php esc_html_e('Start Watching Now', 'cine-movie-engine'); ?></a>
</div>
<p style="margin-top: 30px; font-size: 14px;">
    <?php esc_html_e('If you have any questions or did not authorize this transaction, please contact our support team immediately.', 'cine-movie-engine'); ?>
</p>