On this page
A notification can be sent before a separate reward service has produced a final result. If its template assumes the result exists, the customer may receive “Your reward is $” or, worse, a fabricated zero. The problem is not simply ugly formatting. The message has assigned meaning to data that was never available at that send event.
Consider a hypothetical appliance store that wants a reward note in its order confirmation. The purchase notification has order context, but the reward amount becomes authoritative only after a later review. The template needs to explain that next step without pretending a private provider field is automatically available in Shopify Liquid.
Inventory variables supported by the chosen notification
Start with the exact notification type and its documented variables. Shopify provides a notification variable reference; availability must be checked for the selected notification rather than assumed from another template or API response. Shopify notification variables
Create an inventory with four columns: desired message element, supported source, availability at send time and fallback. For the appliance example, an order label may be available, while an approved reward amount may not be. The public campaign terms link might be configured separately under the store’s approved content process.
| Desired element | Proposed source | Availability question | Safe fallback |
|---|---|---|---|
| Purchase reference | Supported notification variable | Does this notification expose it? | Omit the optional reference label |
| Public offer explanation | Approved template content | Is this template limited to the right campaign? | Neutral reward-process guidance |
| Final award amount | Authorized reward result | Is it actually present at this send event? | Do not announce an amount |
| Recipient next step | Approved journey destination | Is the route suitable for this customer? | Explain where later instructions will arrive |
These are design categories, not claims that Shopify exposes a particular reward variable. If the required data is absent, adding an invented Liquid property will not create it. The team must either use an approved integration that supplies the necessary value or move the amount-specific communication to the system and event that actually have it.
Record who owns the mapping. The notification editor controls presentation; the integration owner confirms data availability; the campaign owner approves the meaning. A template preview with sample text does not replace that three-way agreement.
Distinguish static and dynamic conditions. A static link to the approved public terms can be configured in the template if it applies to the message. A dynamic personal claim destination requires a separate authorized data contract. Do not place a generic claim-looking URL into the template merely to make the button appear complete.
Guard optional reward values and escape displayed content
A guard should test the whole prerequisite set for the message, not just whether one value is nonempty. To announce a final reward amount, the template may need an authoritative stage, a valid amount, its currency and the relevant program context. A number alone does not establish what it represents.
The following is original pseudocode for the decision, not a drop-in Shopify Liquid template:
if final_award_is_authoritative
and amount_is_present
and currency_is_present
and message_applies_to_this_purchase:
render_escaped_approved_amount_message()
else if approved_public_offer_context_is_present:
render_purchase_review_message_without_final_amount()
else:
omit_reward_specific_claim_or_use_approved_neutral_guidance()
This intentionally does not define a made-up rebate.amount object. The implementation should translate the decision only after confirming which supported variables or approved integration values actually exist.
Missing and zero are different. A valid zero may represent an established outcome under a particular contract; a missing value means the template does not know. Do not use a default that turns an absent amount into $0.00. Likewise, do not treat a string containing spaces as a meaningful program reference.
Escape dynamic text before displaying it in HTML. A customer-entered label or imported campaign name should not become arbitrary markup inside the notification. Use the supported formatting and escaping behavior appropriate to the template, and validate links against the approved destination rules.
Keep currency with the amount. A bare 25 can be ambiguous even when the number is correct. Formatting must follow the actual value’s currency and unit contract. If the integration supplies minor units, convert them under the documented mapping rather than assuming every field is already a decimal display value.
A useful review question is: “What fact would this sentence assert if every optional variable disappeared?” If the remaining text still says “Your card is ready,” the guard is incomplete. The entire claim and its action should be conditional on the authoritative state, rather than only hiding the number within an otherwise final-sounding sentence.
Preview missing, partial and complete data cases
Test a matrix of deliberately incomplete inputs. The appliance store should preview at least a normal purchase with no reward result, a complete authoritative result, a missing currency, an empty destination and a long approved campaign label. It should also inspect the plain-text or reduced-format experience available to recipients.
| Fixture | Expected output |
|---|---|
| Order context only | Purchase confirmation and approved later-step guidance |
| Amount present but approval absent | No final award announcement |
| Approval present but currency absent | No ambiguous amount |
| Complete approved result | Correct amount, currency and permitted next action |
| Unsafe or unapproved destination | No active claim link |
| Dynamic text contains markup characters | Characters display safely as text |
| All optional reward data absent | Complete readable notification without broken fragments |
The test should inspect both visible output and link destinations. A button can display a harmless label while its underlying URL contains the wrong campaign or a sensitive token. Confirm that any personal destination follows the approved provider flow and is not copied into unrelated tracking parameters.
A difficult case is a notification resent after the order changes. Determine whether the resend uses the original event data, current order data or an integration snapshot. The template should not accidentally combine an old reward statement with a new purchase total. If the selected notification cannot establish a consistent state, keep its reward content limited to stable process guidance.
Another useful test is a campaign-specific template applied to a noncampaign order. A static sentence about a $25 reward may render perfectly but still be false for that purchase. Ensure the condition that selects the content is supported and authoritative. If the store cannot provide that condition reliably, use a more general statement or a separate approved message.
Keep the accepted previews with the template version and the data contract. Record the exact cases that were checked, including the empty case. This lets the next editor see why a guard exists and discourages removing it because the fully populated preview looks cleaner without conditional logic.
The finished template should remain a coherent customer message when optional reward data is absent. Once that is true, a later authorized message can provide the personal result through the system that actually knows it, while Shopify’s purchase notification continues to do its own job accurately.
Use one deliberate delay fixture during acceptance. Send the purchase notification while the reward result is absent, then make an authoritative result available in the separate test system. Confirm that the already-sent email remains a truthful statement of the earlier stage and that the later approved communication provides the new information. This tests the wording over time, rather than only at the moment of rendering. A phrase such as “your reward is being reviewed” can remain historically accurate; a phrase that invents a final amount cannot be repaired merely because the later amount happens to match it.
Request a technical review of your supported Shopify notification data path.
Source references
This guide is general information, not financial, legal, tax or regulatory advice. Eligibility, card availability, permitted use and responsibilities depend on the applicable offer and card terms.
