How do I customize order confirmation emails per product?

How do I customize order confirmation emails per product?

BuriedInWork
Tourist
25 0 2

How do I customize order confirmation emails per product? For example, after someone orders a product, we need to send them a link to a webpage to provide additional information.

 

Thanks!

Replies 8 (8)

rajimulislamjoy
Shopify Partner
429 41 74

Customize order confirmation emails per product in Shopify, you'll need to use Shopify's Liquid code within the email templates.

Follow these steps

 

  1. Go to Settings > Notifications in your Shopify admin.
  2. Select Order confirmation.
  3. Use Liquid code to insert conditional statements based on the product ordered.
  4. Include your custom message and link within these conditional statements.

 

Thanks

Please don't forget to Like & Mark Solution to the post that helped you. Thanks!
If you'd like to Hire Me , You Can Hire Official Shopify Expert
Need a Shopify Designer or Dropshipping Expert ?
Hire us at WhatsApp! For Shopify Design | Shopify Customize | Dropshipping
BuriedInWork
Tourist
25 0 2

That's helpful, thank you! I'm not great at coding so I used ChatGPT... does this look correct to you?

 

The title of the product is "Estate Preparation Package" Thanks!

 

<!-- Add the section for the estate preparation package -->
{% assign estate_preparation_package = false %}
{% for line_item in line_items %}
{% if line_item.title contains 'Estate Preparation Package' %}
{% assign estate_preparation_package = true %}
{% endif %}
{% endfor %}
{% if estate_preparation_package %}
<p>Thank you for purchasing the Estate Preparation Package. To allow us to customize your Estate Preparation Package to your unique circumstance, please complete your onboarding form by visiting the following link: <a href="https://buriedinwork.com/eppintakeform">Complete Onboarding Form</a></p>
{% endif %}

cr7fan
Tourist
3 1 1

Hi @BuriedInWork 

I believe you can use the simpler code provided below to check if any of the array items contain the string 'Estate Preparation Package'.

 

{% assign has_estate_package = line_items | map: 'title' | contains: 'Estate Preparation Package' %}

 

If you prefer to use the code you provided earlier, you should consider adding at least one additional line of code below.

 

{% break %}

 


Thanks

ChiZhengLin
aaser018
Visitor
1 0 0

Quick question:

  • What if you have more than 2 products that you'd like to create custom email confirmations for -- will this still work?
  • Do you know of any developers who could help us with this?
cr7fan
Tourist
3 1 1

So, @aaser018 , you meant the case when the customer ordered several products?

ChiZhengLin
thecontractor
Tourist
5 0 3

In my case, I'm trying to hide the single price for line items in a bundle, while showing it when the product is not part of a bundle. 


 

{% assign has_estate_package = line_items | map: 'title' | contains: 'Estate Preparation Package' %}

 


Using that "simpler" way above did not work for my use case. Instead, I referred back to the first answer and that ended up working.

 

{% assign dont_show_bundle_price = false %}

{% if line.title contains 'BUNDLE' %}
  {% assign dont_show_bundle_price = true %}
{% endif %}

{% if line.product.title contains 'BUNDLE' %}
  {% assign dont_show_bundle_price = true %}
{% endif %}

{% if line.variant.title contains 'BUNDLE' %}
  {% assign dont_show_bundle_price = true %}
{% endif %}

{% if dont_show_bundle_price %}
  <!-- dont show bundle price -->
{% else %}
  <!-- show the price for individual products -->
{% endif %}

 

Just wanted to share in case someone runs into this issue 🙂 

 

I fix stuff and I know things.
thecontractor
Tourist
5 0 3

Instead of using "title contains 'BUNDLE'" you can probably use "tag" or "type."

I fix stuff and I know things.
YarnDesigners
Visitor
1 0 0

This looks good, I'd like to try it- is there a specific place in the email this code needs to go into?