<?php

declare(strict_types=1);

namespace Enot;

if (!defined('ABSPATH')) {
    exit;
}

require_once __DIR__ . '/header.php';

?>
<form id="email-form" method="post">
    <?php

    \wp_nonce_field('enot-admin-email-settings');

    ?>

    <input type="hidden" name="enot-settings" value="email">

    <div class="row bg-white p-4 my-3 rounded-2">
        <h2><?php \esc_html_e('Email', 'error-monitor-and-notifier') ?></h2>
        <p><?php \esc_html_e('Specify an email address to receive notifications about errors and exceptions. Leave the field empty to disable notifications.', 'error-monitor-and-notifier') ?></p>

        <div class="email-address">
            <label for="email"><?php \esc_html_e('Email Address', 'error-monitor-and-notifier') ?></label>
            <input type="email" name="email" id="email" value="<?php echo \esc_attr($options['email']) ?>">
        </div>

        <div class="test-notification mt-3">
            <a href="javascript:void(0)" id="trigger-error" class="button" disabled><?php \esc_html_e('Test Email Notification', 'error-monitor-and-notifier'); ?></a>
            <?php

            // phpcs:disable PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage

            ?>
            <img id="spinner" src="<?php echo \esc_url(ENOT_PLUGIN_ROOT_URL . 'assets/images/loader.gif') ?>" width="31" height="31" alt="Spinner" class="d-none">
        </div>
    </div>

    <div class="submit">
        <input type="submit" class="button button-primary" value="<?php echo \esc_attr(\__('Save', 'error-monitor-and-notifier')) ?>">
    </div>

</form>

</div>