Order Confirmation Notification - Add text if products "contains" liquid not working

Hi All

Can anyone tell why this isn’t working for the notifications liquid? I want to send a link to an instruction book link if the product title contain a certain word. EG. Book. I copied the below straight of the shopify developers page and it doesn’t want to work. Tried adding tags to products as well and still no luck.

None of these want to work for me.

{% if product.tags contains “Book” %}
Add Line of text here.
{% endif %}

{% if line.product.title contains “Book” %}
Add Line of text here.
{% endif %}

{% if product.title contains “Book” %}
Add Line of text here.
{% endif %}

Thanks in advance.

Where did you add the code in relation to the other parts? This is important.

For example you wouldn’t be able to add this anywhere:

{% if product.tags contains "Book" %}
Add Line of text here.
{% endif %}

It would have to be within a loop where a product object is defined.

If you are able to share more of the code that would be useful. If you have sensitive info in that you don’t want to share it’s ok if you just redact those bits.

Hi Jason

Thanks for the response. I was adding the code in the main body of the text, at the top of the order confirmation notification email. The confirmation is the generic shopify one copied below. The 2 lines of text which i wanted to insert based on the products in the confirmation are below.

If you have purchased Paparazzo with one of our bundles your items will be sent separately. You will receive two tracking numbers. One for Paparazzo and one for the other items. This is due to Paparazzo being shipped via a special shipping line. Whilst we ship the items at the same time, they may not arrive together.> > For instructions to operate Poppy - our Bluetooth Camera Remote, please click here.

Thank you

{% capture email_title %}Thank you for your purchase! {% endcapture %}
{% capture email_body %}
  {% if requires_shipping %}
  {% 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 }}, this email is to confirm your order with [heypaparazzo.com](https://www.heypaparazzo.com). We're getting your order ready to be shipped. 

Please check the details below and advise us within 2 hours of any changes. We will notify you when your product has been shipped.

    {% endcase %}
      {% if delivery_instructions != blank  %}
        

**Delivery information:** {{ delivery_instructions }}

      {% 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 }}

**Please note:** If you have purchased Paparazzo with one of our bundles your items will be sent separately. You will receive two tracking numbers. One for Paparazzo and one for the other items. This is due to Paparazzo being shipped via a special shipping line. Whilst we ship the items at the same time, they may not arrive together.

For instructions to operate Poppy - our Bluetooth Camera Remote, please click [here.](https://heypaparazzo.com/pages/poppy-bluetooth-camera-shutter-remote-instructions)

We would love if you joined our community on [Instagram](https://www.instagram.com/heypaparazzo). Be sure to tag us in your content so we can feature you on our page. 

Feel free to send us a message anytime. We look forward to getting creative with you.

Matt

Owner

Team Paparazzo

            {% 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.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 %}
        

</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 current_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>

    **{{ current_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>