';
$out .= '';
// The strip on top. It carries no text, it is there so the colour is seen
// even in a client that throws the border away.
$out .= '| | ';
// ---- the head: what came in, from which form, on which site ----
$out .= '| ';
$out .= ' '
. esc_html__( 'New entry', '2ranq-forms' ) . ' ';
$out .= ''
. esc_html( $title ) . ' ';
$under = trim( $site . ( '' !== $site && '' !== $date ? ' · ' : '' ) . $date );
if ( '' !== $under ) {
$out .= '' . esc_html( $under ) . ' ';
}
$out .= ' | ';
// ---- the answers ----
$out .= '';
$out .= '';
$last = count( $rows ) - 1;
foreach ( array_values( $rows ) as $i => $row ) {
$label = isset( $row['label'] ) ? (string) $row['label'] : '';
$value = isset( $row['value'] ) ? (string) $row['value'] : '';
$edge = 'border-top:1px solid #e5e7eb;' . ( $i === $last ? 'border-bottom:1px solid #e5e7eb;' : '' );
$out .= '| ';
$out .= ' '
. esc_html( $label ) . ' ';
// An empty answer gets a dash. A blank space would read as a fault in the
// message rather than as an answer nobody gave.
$shown = '' === trim( $value )
? '—'
: nl2br( esc_html( $value ) );
$out .= ''
. $shown . ' ';
$out .= ' | ';
}
$out .= ' | ';
// ---- the way in ----
if ( '' !== $url ) {
$out .= '| ';
$out .= ' | ';
}
// ---- the foot ----
$foot = array();
if ( '' !== $reply ) {
$foot[] = esc_html(
sprintf(
/* translators: %s: the visitor's email address. */
__( 'Hit reply and your answer goes straight to %s.', '2ranq-forms' ),
$reply
)
);
}
$foot[] = esc_html(
sprintf(
/* translators: 1: form name, 2: entry number. */
__( 'Form: %1$s · Entry number %2$d', '2ranq-forms' ),
$title,
$entry_id
)
);
$out .= '| ';
$out .= ' ' . implode( ' ', $foot ) . ' ';
$out .= ' | ';
$out .= ' |