How to send different fulfillment emails based on product type?

Solved

How to send different fulfillment emails based on product type?

danny010385
Tourist
5 1 1

I want to send 2 different fulfillment emails.

If a customer purchases jewelry, ONLY THEN, I want to send them a certificate as well.

All the jewelry titles contain the word "Colier"
So, in the email template, I set up this condition but it doesn't work.
Any ideas? Have I missed something? Or do you know another workaround?! Like a weight condition or idk

{% if line.title contains 'Colier' %}
text here
{% endif %}

Accepted Solution (1)

JoesIdeas
Shopify Partner
2490 229 673

This is an accepted solution.

The variable looks right according to the documentation: https://help.shopify.com/en/manual/orders/notifications/email-variables#line-item

 

Check to make sure that piece of code you shared is inside the line items loop.

 

Example:

{% for line in line_items %}
your code here
{% endfor %}

 

If you don't want to add the certificate for every jewelry item, or you want to add in a place other than inside the line items loop, you could do something like this:

 

{% assign certificate = false %}

{% for line in line_items %}
  {% if line.title contains "Colier" %}
    {% assign certificate = true %}
  {% endif %}
{% endfor %}

{% if certificate %}
show the certificate info here
{% endif %}

 

 

• Creator of Order Automator [auto tag, fulfill, connect FBA, daily jobs]
• Co-Creator of Product Automator [suite of features for products / collections]
• Shopify developer for 10+ years, store owner for 7 years
• Blog: Shopify Tips, Guides, and Automation Tactics

View solution in original post

Replies 3 (3)

danny010385
Tourist
5 1 1

really? no one can help?

JoesIdeas
Shopify Partner
2490 229 673

This is an accepted solution.

The variable looks right according to the documentation: https://help.shopify.com/en/manual/orders/notifications/email-variables#line-item

 

Check to make sure that piece of code you shared is inside the line items loop.

 

Example:

{% for line in line_items %}
your code here
{% endfor %}

 

If you don't want to add the certificate for every jewelry item, or you want to add in a place other than inside the line items loop, you could do something like this:

 

{% assign certificate = false %}

{% for line in line_items %}
  {% if line.title contains "Colier" %}
    {% assign certificate = true %}
  {% endif %}
{% endfor %}

{% if certificate %}
show the certificate info here
{% endif %}

 

 

• Creator of Order Automator [auto tag, fulfill, connect FBA, daily jobs]
• Co-Creator of Product Automator [suite of features for products / collections]
• Shopify developer for 10+ years, store owner for 7 years
• Blog: Shopify Tips, Guides, and Automation Tactics
danny010385
Tourist
5 1 1

Many many many many thanks!
it works!
again tyvm sir!