Hello everyone,
I have some questions related to HTML code on Shopify Email template. We have a plugin E-link from shipping courier that allows us to generate tracking numbers automatically once the order is placed in shopify. Normally when the order is confirmed, there will be an order confirmation sending to customers email.
I ran the test on shopify to see if the plugin is working well, and I received this email conformation like this :
Instead of what is showing on the “Preview” on the notification set up :
I have check with our web developers team regarding HTML code for email templete, and it’s working fine. Other email notification is working fine, only order confirmation is error as shown in the screenshot.
Is this possible that this is shopify operation error, or it is something else?
If shopify team reading this, please help me investigate on this please.
Thank you !
Shay
May 27, 2022, 2:01pm
2
Hi @BDBarcelona1972
Thank you for the screenshots! While I am not a trained developer myself, I do have some experience with liquid and HTML on the Shopify platform. We also have a range of developers here in the forums that might be able to assist as well. Would you be willing to share the template for these emails with us here?
If yes, you can expand the forum reply toolbar by clicking the 3 dots “,” and using the button that looks like </> to share the code. This makes it easier to copy/view for us to see if we can help troubleshoot this.
Hello. Thank you very much f or reaching out, I cannot find the button where I can share the HTML code with you
{% capture email_title %}Thank you for your purchase! {% endcapture %}
{% capture email_body %}
{% if true %}
{% case delivery_method %}
{% when 'pick-up' %}
You’ll receive an email when your order is ready for pickup.
{% when 'local' %}
Hi {{ customer.first_name }}, we're getting your order ready for delivery.
{% else %}
Hi {{ customer.first_name }}, we're getting your order ready to be shipped. We will notify you when it has been sent.
{% endcase %}
{% if delivery_instructions != blank %}
**Delivery information:** {{ delivery_instructions }}
{% endif %}
{% if consolidated_estimated_delivery_time %}
Estimated delivery **{{ consolidated_estimated_delivery_time }}**
{% endif %}
{% endif %}
{% endcapture %}
<table>
<table>
<table>
<table>
<tr>
<td>
{%- if shop.email_logo_url %}
{%- else %}
#
{{ shop.name }}
{%- endif %}
</td>
<td>
Order {{ order_name }}
</td>
</tr>
</table>
</table>
</table>
<table>
<table>
## {{ email_title }}
{{ email_body }}
{% if order_status_url %}
<table>
<tr>
<td>
</td>
</tr>
<table>
<tr>
<td>
View your order
</td>
</tr>
</table>
{% if shop.url %}
<table>
<tr>
<td>
or Visit our store
</td>
</tr>
</table>
{% endif %}
</table>
{% else %}
{% if shop.url %}
<table>
<table>
<tr>
<td>
Visit our store
</td>
</tr>
</table>
</table>
{% endif %}
{% endif %}
</table>
</table>
{% assign gift_card_line_item = line_items | where: "gift_card" %}
{% if gift_card_line_item.first %}
<table>
<table>
<tr>
<td>
### Gift card
</td>
</tr>
</table>
<table>
<tr>
<td>
You’ll receive separate emails for any gift cards.
</td>
</tr>
</table>
</table>
{% endif %}
<table>
<table>
<tr>
<td>
### Order summary
</td>
</tr>
</table>
<table>
{% for line in subtotal_line_items %}
{% endfor %}
<table>
<table>
<td>
{% if line.image %}
{% endif %}
</td>
<td>
{% 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.selling_plan_allocation %}
{{ line.selling_plan_allocation.selling_plan.name }}
{% 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 %}
</td>
{% if line.original_line_price != line.final_line_price %}
<del>{{ line.original_line_price | money }}</del>
{% endif %}
{% if line.final_line_price > 0 %}
{{ line.final_line_price | money }}
{% else %}
Free
{% endif %}
</table>
</table>
<table>
<td>
</td>
{% 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 delivery_method == 'pick-up' %}
{% else %}
{% endif %}
{% if total_duties %}
{% endif %}
{% if total_tip and total_tip > 0 %}
{% endif %}
<table>
<tr>
<td>
Discount
{{ discount_title }}
</td>
<td>
**-{{ discount_application.total_allocated_amount | money }}**
</td>
</tr>
<tr>
<td>
Subtotal
</td>
<td>
**{{ subtotal_price | money }}**
</td>
</tr>
<tr>
<td>
Pickup
</td>
<td>
**{{ shipping_price | money }}**
</td>
</tr>
<tr>
<td>
Shipping
</td>
<td>
**{{ shipping_price | money }}**
</td>
</tr>
<tr>
<td>
Duties
</td>
<td>
**{{ total_duties | money }}**
</td>
</tr>
<tr>
<td>
Taxes
</td>
<td>
**{{ tax_price | money }}**
</td>
</tr>
<tr>
<td>
Tip
</td>
<td>
**{{ total_tip | money }}**
</td>
</tr>
</table>
<table>
<tr>
<td>
Total
</td>
<td>
**{{ total_price | money_with_currency }}**
</td>
</tr>
</table>
{% if total_discounts > 0 %}
You saved {{ total_discounts | money }}
{% endif %}
{% assign transaction_size = 0 %}
{% assign transaction_amount = 0 %}
{% for transaction in transactions %}
{% unless transaction.kind == "capture" or transaction.kind == "void" %}
{% assign transaction_size = transaction_size | plus: 1 %}
{% assign transaction_amount = transaction_amount | plus: transaction.amount %}
{% endunless %}
{% endfor %}
{% if transaction_size > 1 or transaction_amount < total_price %}
{% for transaction in transactions %}
{% if transaction.status == "success" and transaction.kind == "authorization" 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 %}
<table>
<tr>
<td colspan="2">
</td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>
<tr>
<td>
{{transaction_name}}
</td>
<td>
**{{ transaction.amount | money }}**
</td>
</tr>
Refund
<small>{{ refund_method_title | capitalize }}</small>
**- {{ transaction.amount | money }}**
</table>
{% endif %}
</table>
</table>
</table>
<table>
<table>
<tr>
<td>
### Customer information
</td>
</tr>
</table>
<table>
{% if requires_shipping and shipping_address %}
{% endif %}
{% if billing_address %}
{% endif %}
<table>
<tr>
<td>
#### Shipping address
{{ shipping_address | format_address }}
</td>
<td>
#### Billing address
{{ billing_address | format_address }}
</td>
</tr>
</table>
{% if requires_shipping and shipping_address %}
{% endif %}
{% assign transaction_count = transactions | size %}
{% if transaction_count > 0 %}
{% endif %}
<table>
<tr>
<td>
#### Shipping method
{{ shipping_method.title }}
</td>
<td>
#### Payment method
{% for transaction in transactions %}
{% if transaction.status == "success" or transaction.status == "pending" %}
{% if transaction.kind == "authorization" or transaction.kind == "sale" %}
{% if transaction.payment_details.credit_card_company %}
ending with {{ transaction.payment_details.credit_card_last_four_digits }} — **{{ transaction.amount | money }}**
{% elsif transaction.gateway_display_name == "Gift card" %}
ending with {{ transaction.payment_details.gift_card.last_four_characters | upcase }} — **{{ transaction.amount | money }}**
Gift card balance: {{ transaction.payment_details.gift_card.balance | money }}
{% else %}
{{ transaction.gateway_display_name }} — **{{ transaction.amount | money }}**
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
</td>
</tr>
</table>
</table>
</table>
<table>
<table>
<tr>
<td>
If you have any questions, reply to this email or contact us at [{{ shop.email }}](mailto:{{ shop.email }})
</td>
</tr>
</table>
</table>
</table>
Shay
May 27, 2022, 6:33pm
5
Thank you @BDBarcelona1972 for the confirmation email template!
I was able to test this on my own store and can confirm that for myself it worked exactly as expected. I used the preview from within the notifications section of the admin, sent myself a test version of the email and placed a live order on my store using the same template all with success.
I would be curious to see if there is some kind of potential spam flag from your email host that could be interfering. You can test this using this awesome free website: https://www.mail-tester.com . Place a test order on the store using the unique email address they provide you to see how their system receives the email.
I would also try changing your store contact email to a different email host to test and see if it is replicated across different email platforms (I was using GMAIL for business). You can try an outlook.com email or Zoho for free webmail hosting.
Please keep notes and screenshots/copies of the emails as examples for the different platform experiences. If it is persisting across email providers then we will want our technical team to review how the emails are being sent out and if it is an issue with the platform vs the email host.