post_title) ? (string) $product->post_title : __('the product', 'fluent-cart'); // The item the review names, when it does — resolved by the same helper every // other surface uses, so the email can never disagree with the product page // about what a review is about. On a copy: the helper sets item_label as an // attribute, and this template can render inside the request that approved // the review, on the very model the caller goes on to save() — a label left // on it would be written as a column the table does not have. $reviewWithItemLabel = clone $review; \FluentCart\App\Services\ProductReviewService::attachItemLabels([$reviewWithItemLabel]); $itemLabel = trim((string) $reviewWithItemLabel->getAttribute('item_label')); if ($itemLabel !== '') { /* translators: 1: product title, 2: item (variation) label */ $productTitle = sprintf(__('%1$s (%2$s)', 'fluent-cart'), $productTitle, $itemLabel); } $productId = $product && !empty($product->ID) ? (int) $product->ID : (int) $review->post_id; $productUrl = $productId ? get_permalink($productId) : ''; $reviewerName = trim((string) $review->reviewer_name); $rating = max(0, min(5, (int) $review->rating)); $isVerified = !empty($review->is_verified); ?>

' . esc_html($productTitle) . '' ); ?>

0) : ?>

title)) : ?>

title); ?>

content)); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- escaped by esc_html() before nl2br() ?>

→