Dynamic Text
Overview
The messages you write for your customers, such as a download warning or a return message, support dynamic text: a simple way to add formatting, links and lists, and to insert values from your products' Shopify metafields. It works like Markdown, with a few additions.
Where you can use it
Dynamic text works in every message shown on the order status page:
- Download Prevention and Reveal Key Prevention messages
- the Non-Refundable Message
- the Return Message and Error Message
- the Download Exceeded and Expiration messages
Titles, button text and license key terminology are plain text.
Supported Inputs
| Description | Input | Output | Notes |
|---|---|---|---|
| Bold | **Hello** | Hello | |
| Hyperlink | [Visit us](https://example.com) | Visit us | The link will open in a new tab. |
| Unordered List Item | - item one- item two |
| Each list item must be on a new line. |
| Ordered List Item | 1. item one2. item two |
| Each list item must be on a new line. |
| Horizontal Divider | --- | Must be alone on its own line, with a blank line above and below. In the checkout extension, the divider spans full width. | |
| Line Break | Hello<br>World | Hello World | |
| Tab Spacing | <tab>Indented text | Indented text | |
| Shopify Metafield | {{ resource.namespace.key }} | Windows 11 | See more details below. |
Example
This Download Prevention message shows the customer a bold heading, the product's operating system from its metafield (for example "Windows 11"), a numbered list, and a link to your contact page.
**Before you download**
This file requires {{ product.custom.operating_system }}.
1. Unzip the file.
2. Run setup.exe.
Need help? [Contact us](https://example.com/contact)
Shopify Metafields
Insert a product's or variant's metafield value straight into your message. For example, set an operating system metafield on all your products, and include it in a warning message, so each customer sees the requirement for the product they bought.
The value comes from the product the message is shown on, so one store-wide message can show different values for different products.
Finding a metafield
Metafields are written as resource, namespace and key, inside double braces: {{ resource.namespace.key }}.
- In your Shopify admin, go to Settings → Metafields and metaobjects.
- Choose Products or Variants. This is the resource:
productorvariant. - Select the metafield. The
namespace.keyis shown under its name.
For example, {{ product.custom.operating_system }} or {{ variant.custom.edition }}.
Things to know
- Metafields are checked as you type. The app confirms with Shopify that the metafield exists, and tells you if it doesn't. A store-wide message isn't tied to one product, so the preview can't show a real value. Check a real order to see it.
- Only product and variant metafields are supported.
- Supported metafield types: text (single and multi line), integer, decimal, true or false, date, date and time, link, URL, and ID, and lists of most of these.
- If a product has no value for the metafield, customers see a blank or N/A in its place. Set the metafield on every product that shows the message.
- The Extension Preview is close to, but not exactly, what customers see. Shopify draws the order status page with its own components.