<?php
/**
 *
 * Part loop
 *
 */
?>
<?php foreach( $form['parts'] as $part ) : ?>

	<?php if ( happyforms_email_is_part_visible( $part, $form, $response ) ) : ?>

	<b><?php echo happyforms_get_email_part_label( $response, $part, $form ); ?></b><br>
	<?php echo happyforms_get_email_part_value( $response, $part, $form, 'admin-email' ); ?>
	<br><br>

	<?php endif; ?>

<?php endforeach; ?>

<?php
/**
 *
 * Tracking number
 *
 */
?>
<?php if ( happyforms_get_form_property( $form, 'unique_id' ) ) : ?>

#<?php echo $response['tracking_id']; ?>

<?php endif; ?>

<?php
/**
 *
 * Referer
 *
 */
?>
<?php if ( happyforms_get_form_property( $form, 'alert_email_include_referral_url' ) ) : ?>

	<?php $referer = happyforms_get_meta( $response['ID'], 'client_referer', true ); ?>

	<?php if ( ! empty( $referer ) ) : ?>
		<b><?php _e( 'Referral', 'happyforms' ); ?></b><br>
		<?php echo $referer; ?>
		<br><br>
	<?php endif; ?>

<?php endif; ?>

<?php
/**
 *
 * User data
 *
 */
?>
<?php
$client_info = happyforms_get_client_info();

if ( $client_info->should_save_meta_data( $form ) && happyforms_get_form_property( $form, 'alert_email_include_user_data' ) ) : ?>

	<?php echo $client_info->get_client_info_for_email( $response ); ?>
	<br><br>

<?php endif; ?>

<?php
/**
 *
 * Mark and reply link
 *
 */
?>
<?php if ( happyforms_get_form_controller()->get_first_part_by_type( $form, 'email' ) ) : ?>

	<?php if ( happyforms_get_form_property( $form, 'email_mark_and_reply' ) ) : ?>

	<a href="<?php echo happyforms_get_reply_and_mark_link( $response['ID'] ); ?>"><?php _e( 'Reply to this message and mark it as read', 'happyforms' ); ?></a>

	<?php endif; ?>

<?php endif; ?>
