<?php
	/**
	 * Submission Status Notification - Sub Tab View
	 *
	 * @package EASYFUA
	 */

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

	$lang        = easyfua_lang();
	$option_name = 'easyfua_settings' . $lang;
	$notif       = easyfua_settings( 'submission_status' );

	// Message body template.
	$message_body = isset( $notif['message'] ) && ! empty( $notif['message'] ) ? $notif['message'] : null;
if ( empty( $message_body ) ) {
	$message_body = easyfua_email_template( 'status-notification' );
}
?>
<table class="form-table easyfua-email-templates" role="presentation">
	<tbody>
		<tr>
			<th scope="row"><?php esc_html_e( 'To', 'easy-file-upload-approval' ); ?></th>
			<td class="easyfua-text-info">
				<input value="<?php echo isset( $notif['email'] ) ? esc_attr( $notif['email'] ) : ''; ?>" type="text" name="<?php echo esc_attr( $option_name ); ?>[submission_status][email]" placeholder="{user_email}" class="regular-text">
				<p class="description"><?php esc_html_e( 'Add multiple emails separated by commas.', 'easy-file-upload-approval' ); ?></p>
			</td>
		</tr>
		<tr>
			<th scope="row"><?php esc_html_e( 'Subject', 'easy-file-upload-approval' ); ?></th>
			<td class="easyfua-text-info">
				<input value="<?php echo isset( $notif['subject'] ) ? esc_attr( $notif['subject'] ) : ''; ?>" type="text" name="<?php echo esc_attr( $option_name ); ?>[submission_status][subject]" placeholder="<?php esc_attr_e( 'Your uploaded file &#37;s been reviewed', 'easy-file-upload-approval' ); ?>" class="regular-text">
				<p class="description">
					<?php esc_html_e( "&#37;s will become 'file has' for one file or 'files have' for multiple files.", 'easy-file-upload-approval' ); ?>
				</p>
			</td>
		</tr>
		<tr>
			<th scope="row"><?php esc_html_e( 'Headers', 'easy-file-upload-approval' ); ?></th>
			<td class="easyfua-text-info">
				<textarea rows="3" name="<?php echo esc_attr( $option_name ); ?>[submission_status][headers]" placeholder="From: Name &lt;no-reply@yourdomain.com&gt;" cols="40" class="regular-text"><?php echo isset( $notif['headers'] ) ? esc_textarea( wp_specialchars_decode( $notif['headers'] ) ) : ''; ?></textarea>
				<p class="description">
					<?php esc_html_e( 'Use the header format below. Each header must be on a new line.', 'easy-file-upload-approval' ); ?>
				</p>
				<span class="easyfua-admin-tags">
					From: Name &lt;no-reply@yourdomain.com&gt;<br>
					Reply-To: support@yourdomain.com<br/>
					Cc: manager@yourdomain.com
				</span>
			</td>
		</tr>
		<tr>
			<th scope="row"><?php esc_html_e( 'Message Body', 'easy-file-upload-approval' ); ?></th>
			<td class="easyfua-text-info">
				<textarea rows="18" name="<?php echo esc_attr( $option_name ); ?>[submission_status][message]" cols="40" class="regular-text"><?php echo ! empty( $message_body ) ? ( wp_kses_post( $message_body ) ) : ''; ?></textarea>
				<p class="description">
					Tags:
					<code>
						{display_name}, {files_data}, {site_name}
					</code>
				</p>
			</td>
		</tr>
	</tbody>
</table>