How to personalize email order confirmations based on payment method?

Topic summary

Main issue: Personalizing Shopify email order confirmations based on the payment method, with conditions failing for Cash on Delivery (COD) while working for Bank Deposit.

Key details:

  • Liquid (Shopify’s templating language) conditions were used on transaction.gateway_display_name. Equality (==) worked for “Bank Deposit” but not for “Pago contra entrega” (COD).
  • Suggested fix: use “contains” instead of “==” for gateway_display_name, which resolved the OP’s issue.

Subsequent reports:

  • Several users with “Vorauskasse”/“Vorkasse” found that “contains” did not trigger, even when normalizing case with downcase.
  • Alternative workaround shared: check the “gateway” variable directly (e.g., {% if gateway == “My custom payment method” %}) instead of transaction.gateway_display_name or transaction.gateway.

Notes and terms:

  • transaction.gateway_display_name: the display string of the payment gateway, which may vary or include additional text.
  • COD: Cash on Delivery.
  • Code snippets are central to understanding; differences in variable values and matching logic are the core issue.

Outcome and status:

  • OP’s problem resolved using “contains”.
  • For others, the thread suggests using the “gateway” variable as a reliable alternative. Discussion remains partially open for cases where “contains” fails.
Summarized with AI on January 31. AI used: gpt-5.

Hi @LaseMakers

It’s our pleasure when helping you with your issue and getting accepted as a solution.

If you need further support, just let me know and we will support you dedicatedly.

Have a great day!