I sell a mix of products that are shipped and classes that are in-person (these listings are set to non-shippable). When a client purchases a class, the order confirmation email they receive does not contain any of the text I’ve custom added to the notification template.
I see there is a {% if requires_shipping %} line in the code for the notification, but when I remove it I get this error message: Body html Liquid syntax error: ‘endif’ is not a valid delimiter for capture tags. use endcapture
Is there a workaround for this?
Hi @Hustle here it is, thank you!
{% capture email_title %}{{ customer.first_name }}, you’re amazing! Thank you for your order. {% endcapture %}
{% capture email_body %}
{% if requires_shipping %}
If you selected shipping please wait for an email with tracking information.
If local Ottawa pick up was available at checkout (upcoming show date) and you chose it, please wait for an email with instructions.
If you purchased a class please wait for an email with more information.
Thank you for supporting a small independent business!
Questions? Hit ‘reply’ to this email and we’ll be in contact with you within 2 business days.
{% endif %}
{% endcapture %}
{{ email_title }}
.button__cell { background: {{ shop.email_accent_color }}; }
a, a:hover, a:active, a:visited { color: {{ shop.email_accent_color }}; }
{%- if shop.email_logo_url %}
{%- else %}
{%- endif %}
|
Order {{ order_name }}
|
|
|
{{ email_title }}
{{ email_body }}
{% if order_status_url %}
| |
|
{% if shop.url %}
{% endif %}
|
{% else %}
{% if shop.url %}
{% endif %}
{% endif %}
|
|
{% for line in subtotal_line_items %}
{% endfor %}
{% if line.image %}
{% endif %}
|
{% if line.product.title %}
{% assign line_title = line.product.title %}
{% else %}
{% assign line_title = line.title %}
{% endif %}
{% if line.quantity < line.quantity %}
{% capture line_display %} {{ line.quantity }} of {{ line.quantity }} {% endcapture %}
{% else %}
{% assign line_display = line.quantity %}
{% endif %}
{{ line_title }} × {{ line_display }}
{% if line.variant.title != ‘Default Title’ %}
{{ line.variant.title }}
{% endif %}
{% if line.refunded_quantity > 0 %}
Refunded
{% endif %}
{% if line.discount_allocations %}
{% for discount_allocation in line.discount_allocations %}
{% if discount_allocation.discount_application.target_selection != ‘all’ %}
![]()
{{ discount_allocation.discount_application.title | upcase }}
(-{{ discount_allocation.amount | money }})
{% endif %}
{% endfor %}
{% endif %}
|
{% if line.original_line_price != line.final_line_price %}
{{ line.original_line_price | money }}
{% endif %}
{% if line.final_line_price > 0 %}
{{ line.final_line_price | money }}
{% else %}
Free
{% endif %}
|
|
|
{% for discount_application in discount_applications %}
{% if discount_application.target_selection == 'all' %}
{% capture discount_title %}
{% if discount_application.title %}
{{ discount_application.title | upcase }}
{% else %}
Discount
{% endif %}
{% endcapture %}
{% endif %}
{% endfor %} {% if total_duties %} {% endif %} {% if total_tip and total_tip > 0 %} {% endif %}
|
Discount
{{ discount_title }}
|
-{{ discount_application.total_allocated_amount | money }}
|
|
Subtotal
|
{{ subtotal_price | money }}
|
|
Shipping
|
{{ shipping_price | money }}
|
|
Duties
|
{{ current_total_duties | money }}
|
|
Taxes
|
{{ tax_price | money }}
|
|
Tip
|
{{ total_tip | money }}
|
|
Total
|
{{ total_price | money_with_currency }}
|
{% if total_discounts > 0 %}
You saved {{ total_discounts | money }}
{% endif %}
{% assign transaction_size = 0 %}
{% assign transaction_amount = 0 %}
{% for transaction in transactions %}
{% if transaction.status == “success” %}
{% unless transaction.kind == “authorization” or transaction.kind == “void” %}
{% assign transaction_size = transaction_size | plus: 1 %}
{% assign transaction_amount = transaction_amount | plus: transaction.amount %}
{% endunless %}
{% endif %}
{% endfor %}
{% if transaction_size > 1 or transaction_amount < total_price %}
{% for transaction in transactions %}
{% if transaction.status == “success” and transaction.kind == “capture” or transaction.kind == “sale” %}
{% if transaction.payment_details.credit_card_company %}
{% capture transaction_name %}{{ transaction.payment_details.credit_card_company }} (ending in {{ transaction.payment_details.credit_card_last_four_digits }}){% endcapture %}
{% else %}
{% capture transaction_name %}{{ transaction.gateway_display_name }}{% endcapture %}
{% endif %} {% endif %}
{% if transaction.kind == ‘refund’ %}
{% if transaction.payment_details.credit_card_company %}
{% assign refund_method_title = transaction.payment_details.credit_card_company %}
{% else %}
{% assign refund_method_title = transaction.gateway %}
{% endif %} {% endif %}
{% endfor %}
|
|
|
{{transaction_name}}
|
{{ transaction.amount | money }}
|
|
Refund
{{ refund_method_title | capitalize }}
|
- {{ transaction.amount | money }}
|
{% endif %}
|
|
|
|
{% if requires_shipping and shipping_address %}
{% endif %}
Shipping address
{{ shipping_address | format_address }}
|
{% if requires_shipping and shipping_address %}
{% endif %}
{% assign transaction_count = transactions | size %}
{% if transaction_size > 0 %}
{% endif %}
Shipping method
{{ shipping_method.title }}
|
Payment method
{% for transaction in transactions %}
{% if transaction.status == "success" or transaction.status == "pending" %}
{% if transaction.kind == "capture" or transaction.kind == "sale" %}
{% if transaction.payment_details.credit_card_company %}
{% capture credit_card_url %}notifications/{{ transaction.payment_details.credit_card_company | downcase | replace: " ", "_" }}.png{% endcapture %}
Payment method
{% else %}
{{ transaction.gateway_display_name }} — {{ transaction.amount | money }}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
|
|
|
|
If you have any questions, reply to this email or contact us at {{ shop.email }}
|
|
![]()
|
1 Like
So I copied and pasted your code above an unfortunately this didn’t work, I just tested it with a dummy listing. I also tried removing the same line regarding shipping and it still didn’t work. Thanks anyway!
I want everyone to get the same email, but actually I just fixed it! I put the text above the {% if requires_shipping %} line and now it’s working for both non-ship and ship items. Woohoo!