Reviews in emails
Show star ratings, review counts and AI summaries in Shopify's notification emails and in Shopify Messaging.
Shopify's emails are Liquid templates too, so they can show the data 5zero keeps ready. How much depends on the email. Notification emails, like the order confirmation, read each product's rating and review count. Shopify Messaging, Shopify's app for marketing emails, also reads 5zero's own fields, including the AI summary and live signals.
Where to place it
- Order confirmation email, under the order summary
- Order invoice and draft order invoice emails, under the order summary
- Shipping confirmation email, under the shipped items
- Out for delivery and delivered emails, under the items
- Shopify Messaging email, next to a featured product
- Shopify Messaging abandoned checkout email, under the checkout items
What emails can show
| Notification emails | Shopify Messaging | |
|---|---|---|
| Rating and review count per product | Yes | Yes |
| Your shop's overall rating | Yes | Yes |
| AI summary | No | Yes |
| Live signals, like units sold | No | Yes |
| Review texts | No | No |
Review texts stay on your storefront: neither kind of email can load the reviews themselves.
Add stars to a notification
- In your Shopify admin, open Settings → Notifications → Customer notifications and pick an email, like Order confirmation.
- Click Edit code and paste the snippet where the ratings should appear, for example under the order summary.
- Click Save.
{%- for line in subtotal_line_items -%}
{%- assign rating = line.product.metafields.reviews.rating.value | default: 0 | round: 1 -%}
{%- assign count = line.product.metafields.reviews.rating_count | default: 0 -%}
{%- if count > 0 -%}
<p>{{ line.product.title }}: ★ {{ rating }} ({{ count }} reviews)</p>
{%- endif -%}
{%- endfor -%}
<p>★ {{ shop.metafields.reviews.rating.value | round: 1 }} from {{ shop.metafields.reviews.rating_count }} reviews</p>Notification emails can't read 5zero's own fields, so this snippet uses Shopify's standard rating fields, which 5zero keeps up to date. In these templates the rating comes with .value, the review count without it. Products without reviews are skipped.
In shipping emails, subtotal_line_items lists the whole order. To show only the products in that shipment, loop over fulfillment.fulfillment_line_items and read line.line_item.product instead of line.product.
Add ratings to a Shopify Messaging email
- In Shopify Messaging, open an email or a template and click Add section.
- Choose Custom Liquid and paste the snippet. Replace
your-product-handlewith the handle of the product you feature.
{%- assign product = all_products['your-product-handle'] -%}
{%- assign fiveoh = product.metafields['app--324569563137'] -%}
{%- assign count = fiveoh.rating_count | default: 0 -%}
{%- if count > 0 -%}
<p>★ {{ fiveoh.rating.value | round: 1 }} ({{ count }} reviews)</p>
<p>{{ fiveoh.review_summary_short }}</p>
{%- endif -%}The preview in the editor shows your real ratings, so you see the result right away. fiveoh.review_summary and fiveoh.review_summary_long hold the longer summaries, and fiveoh.live_signals the live signals. Like in notification emails, the review count is read without .value.
In the abandoned checkout automation, the email knows the products in the checkout. Loop over abandoned_checkout.line_items and read line.product.metafields['app--324569563137'] instead of picking a product by handle.
Good to know
- In notification emails, the preview and Send test email use sample products, so the stars stay empty there. They show in real emails. To check, send yourself a draft order invoice for a product with reviews.
reviews.ratingandreviews.rating_countare Shopify's standard fields, so another review app in your store can overwrite them. Messaging emails read 5zero's own fields and don't have this problem. See the reference.- This page covers Shopify's notification emails and Shopify Messaging. Other email tools read your store's data in their own way and aren't covered here.