<?php defined('ABSPATH') || exit; ?>
<h2><?php esc_html_e('Email Notification', 'iv1-wp-tools'); ?></h2>
<div id="iv1wpt-settings-email-result" style="margin:15px 0;"></div>
<?php wp_nonce_field('iv1wpt_email_nonce'); ?>
<table class="form-table">
    <tr><th><label for="email_enabled"><?php esc_html_e('Enable email', 'iv1-wp-tools'); ?></label></th><td><input type="checkbox" name="email_enabled" id="email_enabled" value="1" <?php checked($email_settings['enabled']); ?>></td></tr>
    <tr><th><label for="email_recipient"><?php esc_html_e('Recipient', 'iv1-wp-tools'); ?></label></th><td><input type="email" name="email_recipient" id="email_recipient" value="<?php echo esc_attr($email_settings['recipient']); ?>" class="regular-text" placeholder="<?php echo esc_attr(get_option('admin_email')); ?>"><p class="description"><?php
        /* translators: %s: WordPress admin email address */
        printf(esc_html__('Leave empty = WordPress admin email (%s)', 'iv1-wp-tools'), esc_html(get_option('admin_email')));
    ?></p></td></tr>
    <tr><th><?php esc_html_e('Notify on', 'iv1-wp-tools'); ?></th><td><label><input type="checkbox" name="email_on_success" value="1" <?php checked($email_settings['on_success']); ?>> <?php esc_html_e('Success', 'iv1-wp-tools'); ?></label><br><label><input type="checkbox" name="email_on_error" value="1" <?php checked($email_settings['on_error']); ?>> <?php esc_html_e('Error', 'iv1-wp-tools'); ?></label></td></tr>
</table>
<p class="submit" style="margin-top:8px;">
    <button type="button" id="iv1wpt_email_save" class="button button-primary"><?php esc_attr_e("Save email settings", "iv1-wp-tools"); ?></button>
</p>