Change Email confirmation for different products

Highlighted
New Member
2 0 0

Hello!

I am struggling to find answer to this email question, I would really appreciate some help...

 

We sell English courses and single classes. For the single classes we want to add a link directing the students to a booking calendar to choose a time and date (we have the link but don't know how to add a button/link).

For the courses, we want to direct our students to a registration form, again via a different button.

We have 19 courses and 19 single classes options, all with a unique SKU code.

Is this possible? If it is, please could someone help with how to do it? Thanks so much in advance.

0 Likes
Highlighted
Shopify Expert
498 9 96

The best way to do this would be to add your link URL into a product metafield and then check for that and output in the email template.

{% for line in line_items %}
  {% if line.product.metafields.global.link != blank %}
    <a href="{{ line.product.metafields.global.link }}">Choose Class Time</a>
  {% endif %}
{% endfor %}

 

0 Likes
Highlighted
New Member
2 0 0

Hi Gina,

 

Thank you for your reply! Im really sorry, I'm new to editing liquid, and I'm not really sure how to do that.

Would I need to put this bit of code in the email 38 times for all the products? Or is there a way to put a range in?

Also, I only want the customer to receive the link after they have paid for the class.

Thank you. 

Ian

0 Likes
Highlighted
Shopify Expert
498 9 96

The code is just an example and not meant to be copy/pasted in. Basically what the code does is go through all the line items in the order and check if the product has a metafield with the namespace "global" and key "link", and if so output a link. So, no, it would not need to be put in multiple times.

The first thing you'd need to do is save your link URL into a metafield. If you want to use the code above, you'll have to make sure to set up the metafield with the namespace "global" and key "link".

This is all assuming we're putting this code in the order confirmation email, so it is assumed the customer has paid for their order at the time of placing the order.

0 Likes