Liquid를 사용하여 Shopify Messaging 캠페인 사용자 지정하기

Liquid는 Shopify의 간단하고 사용하기 쉬운 프로그래밍 언어이며, Shopify Theme Store의 테마를 빌드하는 데 사용된 것과 동일한 프로그래밍 언어입니다.

완전히 사용자 지정 코드로 작성된 이메일을 생성하거나 템플릿에 사용자 지정 Liquid 섹션을 추가하여 사용자 지정 Liquid로 Shopify Messaging 메시지를 개선할 수 있습니다. 이러한 옵션을 사용하면 사용자 지정 Liquid 또는 HTML을 입력할 수 있습니다.

사용자 지정 Liquid를 사용하여 나란히 배치된 이미지, 사용자 지정 버튼, 사용자 지정 크기 이미지 및 사용자 지정 섹션 크기와 같은 사용자 지정 자산을 표시할 수 있습니다.

고려 사항

Shopify Messaging 메시지에 사용자 지정 Liquid를 추가하기 전에 다음 고려 사항을 검토하십시오.

  • 코드에 포함하는 변수는 사용자 지정 Liquid에서 지원되어야 합니다.
  • 데스크톱 장치에서만 사용자 지정 Liquid 섹션을 생성할 수 있습니다.
  • 사용자 지정 Liquid 이메일에는 unsubscribe_link 또는 unsubscribe_url 변수가 필요합니다. 이메일 확인 추적을 활성화한 경우에는 open_tracking 변수도 필요합니다. 이메일에 필수 변수를 추가하는 방법에 대해 자세히 알아보십시오.
  • 입력하는 코드에는 다음과 같은 제한이 있습니다.
    • 사용자 지정 Liquid 섹션의 경우 최대 50KB입니다.
    • 사용자 지정 코딩된 Liquid 이메일의 경우 최대 500KB입니다.

Liquid로 사용자 지정 코딩된 이메일 생성

이메일을 생성할 때 사용자 지정 Liquid 코드를 사용하려면, 사용자 지정 Liquid 섹션을 추가하거나 Shopify Messaging 캠페인을 생성할 때 직접 코딩을 선택하여 완전히 사용자 지정 Liquid 코드로 이메일을 생성할 수 있습니다.

사용자 지정 Liquid에서 지원되는 Liquid 변수

지원되는 변수를 사용하여 Liquid로 Shopify Messaging 이메일 메시지를 사용자 지정할 수 있습니다. 다음 템플릿 유형에 대해 지원되는 Liquid 변수 목록을 검토할 수 있습니다.

모든 이메일 템플릿에서 지원되는 Liquid 변수

다음 변수를 사용하여 Liquid로 모든 Shopify Messaging 이메일 메시지를 사용자 지정할 수 있습니다.

Shopify Messaging에서 지원하는 Liquid 변수 설명
변수설명
all_products
스토어의 모든 제품입니다.
customer.accepts_marketing
고객이 마케팅을 수락하면 true를 반환하고, 그렇지 않으면 false를 반환합니다.
customer.addresses
고객과 연결된 모든 주소를 반환합니다.
customer.addresses_count
고객과 연결된 주소의 수를 반환합니다.
customer.b2b?
고객이 B2B 고객이면 true를 반환하고, 그렇지 않으면 false를 반환합니다.
customer.current_location
고객에 대해 현재 선택된 회사 위치를 반환합니다.
customer.default_address
고객의 기본 주소를 반환합니다.
customer.email
고객의 이메일 주소를 반환합니다.
customer.first_name
고객의 이름을 반환합니다.
customer.has_account
고객의 이메일이 고객 계정과 연결되어 있으면 true를 반환하고, 그렇지 않으면 false를 반환합니다.
customer.has_avatar?
고객 계정에 아바타가 연결되어 있으면 true를 반환하고, 그렇지 않으면 false를 반환합니다.
customer.id
고객의 ID를 반환합니다.
customer.last_name
고객의 성을 반환합니다.
customer.last_order
주문 테스트를 제외하고 고객이 생성한 마지막 주문을 반환합니다.
customer.name
고객의 전체 이름을 반환합니다.
customer.orders
고객이 생성한 모든 주문을 반환합니다.
customer.orders_count
고객이 생성한 총 주문 수를 반환합니다.
customer.payment_methods
고객의 저장된 결제 방법을 반환합니다.
customer.phone
고객의 전화번호를 반환합니다. 전화번호는 고객이 체크아웃 시 전화번호를 사용했거나 SMS 알림을 수신 동의했거나, 또는 고객 계정에 수동으로 추가한 경우에만 채워집니다.
customer.store_credit_account.balance

관련 컨텍스트와 연결된 통화로 고객의 스토어 크레딧 잔액을 반환합니다. 예:

{{customer.store_credit_account.balance | money_with_currency}}
customer.tags
고객과 연결된 태그를 반환합니다.
customer.tax_exempt
고객이 세금 면제 대상이면 true를 반환하고, 그렇지 않으면 false를 반환합니다.
customer.total_spent
고객이 스토어의 모든 주문에 지출한 총액을 반환합니다.
email.*

이 변수는 다음 이메일 속성에 대한 액세스를 제공합니다.

  • subject는 이메일의 제목 줄을 표시합니다.
  • preview_text는 이메일의 미리 보기 텍스트를 표시합니다.
  • open_tracking
    이 변수는 미리 서식이 지정된 이메일 확인 추적 블록에 대한 액세스를 제공합니다. 사용자 지정 코딩된 이메일을 생성하고 이메일 확인 추적을 활성화한 경우 이 변수가 필요합니다.
    shop.*
    이 변수는 다음 스토어 속성에 대한 액세스를 제공합니다.
  • name은 스토어 이름을 표시합니다.
  • domain은 스토어 기본 도메인을 표시합니다.
  • url은 스토어 URL을 표시합니다.
  • shopify_domain은 스토어 Shopify 도메인을 표시합니다.
    • address 스토어 주소를 표시하며, 다음 주소 속성에 대한 액세스를 제공합니다.
      • address1
      • address2
      • city
      • country
      • phone
      • province
      • zip
    unsubscribe_url
    이 변수는 원시 구독 취소 URL에 대한 액세스를 제공하며 사용자 지정할 수 있습니다. 사용자 지정 코딩된 이메일을 생성하는 경우 unsubscribe_url 또는 unsubscribe_link 변수를 포함해야 합니다. unsubscribe_urlunsubscribe_link는 항상 기본 온라인 스토어 도메인을 가리키며 다른 곳으로 연결되도록 수정할 수 없습니다.

    중단된 체크아웃 이메일에 지원되는 Liquid 변수

    다음 변수를 사용하여 Liquid로 중단된 체크아웃 Shopify Messaging 이메일 메시지를 사용자 지정할 수 있습니다.

    abandoned_checkout 변수는 이메일이 중단된 체크아웃 마케팅 자동화의 일부인 경우에만 채워집니다. 그렇지 않은 경우 변수는 null입니다.

    상품 조회 이탈, 카트, 체크아웃에 지원되는 Shopify Messaging Liquid 변수 설명
    변수설명
    abandoned_checkout.*

    이 변수는 중단된 체크아웃의 다음 속성에 대한 액세스를 제공합니다.

    • url은 중단된 체크아웃의 URL을 표시합니다.
    • line_items 중단된 체크아웃의 처음 5개 품목을 표시합니다. 또한 각 line_items 객체에는 각 제품에 대한 다음 속성이 포함됩니다.
      • components
      • image_url
      • product_title
      • variant_title
      • quantity
    • line_items.components 중단된 체크아웃의 구성 요소를 표시합니다. 또한 각 components 객체에는 각 구성 요소에 대한 다음 속성이 포함됩니다.
      • image_url
      • quantity
      • product_title
      • variant_title
    • remaining_products_count는 중단된 체크아웃에 5개보다 많은 품목이 있는 경우 남은 품목 수를 표시합니다.
    id
    (checkout ID)
    내부용으로 사용되는 체크아웃의 고유 ID입니다.
    shop
    Shopify 스토어 이름입니다.
    name
    체크아웃 번호라고도 하는 중단된 체크아웃의 이름입니다.
    total_price
    주문의 총가격(소계 + 배송비 - 배송 할인 + 세금)입니다.
    shipping_price

    배송 가격입니다.

    예: {{ shipping_price | money }}

    shipping_address
    배송 주소입니다.
    billing_address
    청구 주소입니다.
    line_items
    중단된 체크아웃의 모든 품목 목록입니다.
    unavailable_line_items
    중단된 체크아웃에서 사용할 수 없는 모든 품목 목록입니다.
    note
    중단된 체크아웃에 첨부된 메모입니다.
    landing_site

    고객이 사용한 방문 사이트의 경로입니다. 고객이 스토어에 도달했을 때 처음으로 액세스한 페이지입니다.

    예: /products/great-product?ref=my-tracking-token

    landing_site_ref

    방문 사이트에서 참조 매개 변수를 추출합니다. 참조 매개 변수는 ref, source, r일 수 있습니다.

    landing_site/products/great-product?ref=my-tracking-token인 경우 landing_site_ref 은(는) my-tracking-token입니다. 참조 매개 변수가 특정 값과 같은 경우 특정 작업을 수행할 수 있습니다.

    {% if landing_site_ref == 'my-tracking-token' %}
    My action...
    {% endif %}
    referring_site

    고객을 스토어로 유도한 참조 페이지의 URL입니다.

    예: https://www.google.com/?s=great+products

    created_at

    고객이 중단한 체크아웃을 생성한 날짜와 시간입니다.

    closed_at

    체크아웃이 종료된 날짜와 시간입니다.

    customer_locale
    고객 로케일에 대한 두세 글자 언어 코드이며, 선택적으로 지역 수정자가 뒤따를 수 있습니다. 예:
    en
    ,
    en-CA
    item_count
    모든 품목 수량의 합계입니다.
    unique_gateways
    체크아웃 시 사용할 수 있는 고유 결제 서비스 공급업체 목록입니다.
    discount
    중단된 체크아웃의 카트 또는 품목에 적용된 할인입니다.
    discounts
    체크아웃에 적용된 할인 목록입니다.
    successfully_applied_discounts
    체크아웃에 성공적으로 적용된 할인입니다.
    discounts_amount

    모든 할인에 의해 적용된 할인액(달러 금액)입니다.

    예: +$5.00

    discounts_savings

    모든 할인으로 인해 절약된 금액(달러 금액)입니다.

    예: -$5.00

    buyer_accepts_marketing
    다음 값을 반환합니다.
    true
    또는
    false
    고객이 중단된 체크아웃 중에 마케팅을 수락했는지 여부에 따라 다릅니다.
    subtotal_line_items
    팁 품목을 제외하고 체크아웃 시 소계 가격을 계산하는 데 사용되는 품목입니다.
    requires_shipping
    다음 값을 반환합니다.
    true
    체크아웃에 배송이 필요한 품목이 하나 이상 있는 경우입니다.
    subtotal_price
    체크아웃 시 품목의 소계 가격입니다.
    email
    중단된 체크아웃과 연결된 이메일입니다.
    shop_name
    스토어 이름입니다.
    tax_lines

    세금 유형별로 분류된 세금입니다.

    {% for tax_line in tax_lines %}
    {{ tax_line.title }} ({{ tax_line.rate_percentage }}%) : {{ tax_line.price | money_with_currency  }}
    {% endfor %}
    tax_price
    체크아웃에 있는 모든 품목의 합산 세금입니다.
    attributes

    중단된 체크아웃에 첨부된 모든 특성입니다.

    예: {{ attributes.gift-note }}

    shipping_method
    체크아웃 시 사용 가능한 첫 번째 배송 방법에 대한 정보입니다.
    shipping_methods
    체크아웃 시 사용 가능한 배송 방법입니다.
    free
    다음 값을 반환합니다.
    true if the total price of the checkout is zero.
    free_shipping
    다음 값을 반환합니다.
    true
    체크아웃에 배송이 필요하지 않거나 배송비가 0인 경우입니다.
    different_billing_address
    다음 값을 반환합니다.
    true
    또는
    false
    배송 주소가 청구 주소와 동일한지 여부에 따라 결정됩니다.
    customer
    고객 출력의 특성을 포함하는 고객 개체입니다.
    gift_cards
    체크아웃에 적용된 기프트 카드입니다.
    gift_cards_amount
    기프트 카드로 결제될 체크아웃 가격의 금액입니다.
    transactions
    체크아웃의 거래입니다.
    shareable_url
    품목에 있는 첫 번째 제품의 URL입니다.
    shareable_title
    첫 번째 품목의 제품 이름입니다.
    total_tip
    고객이 체크아웃 시 추가한 총 팁입니다.
    discount_applications
    체크아웃에서 품목이 할인된 이유와 방법을 설명합니다.
    cart_level_discount_applications
    카트에 대한 카트별 할인 적용입니다.
    currency
    중단된 체크아웃의 통화입니다.
    line_items_subtotal_price
    모든 품목 할인이 적용된 후 체크아웃의 모든 품목 가격 합계입니다.

    상품 조회 이탈 및 중단된 카트 이메일에 대한 Liquid 변수

    abandoned_visit.* 변수는 이메일이 중단된 카트 또는 상품 조회 이탈 마케팅 자동화의 일부인 경우에만 채워집니다. 이 변수를 통해 액세스할 수 있는 다음 속성을 검토하십시오.

    Shopify Messaging에서 지원하는 Liquid 변수 설명
    변수설명
    abandoned_visit.*

    이 변수를 통해 중단된 카트 또는 조회 이탈의 다음 속성에 액세스할 수 있습니다.

    • url은 중단된 카트 또는 조회 이탈의 URL을 표시합니다.
    • products_added_to_cart 은(는) 이탈한 방문의 카트에 추가된 처음 5개 제품 품목을 표시합니다. 또한 각 products_added_to_cart 개체에는 각 제품에 대한 다음 속성이 포함됩니다.
      • title
      • image_url
      • variant_title
      • quantity
    • products_viewed 은(는) 이탈한 방문 중에 조회된 처음 5개 제품을 표시합니다. 또한 각 products_viewed 개체에는 각 제품에 대한 다음 속성이 포함됩니다.
      • title
      • description
      • image_url
      • url
      • image_alt_text
    • remaining_cart_products_count는 중단된 체크아웃에 품목이 5개 이상 있는 경우 나머지 품목 수를 표시합니다.

    필수 변수 사용

    사용자 지정 Liquid 이메일을 생성할 때 unsubscribe_link 또는 unsubscribe_url 변수는 필수입니다. 이메일 확인 추적을 활성화한 경우 open_tracking 변수도 필수입니다.

    이러한 변수는 이메일 코드의 어느 곳에나 삽입할 수 있지만 가장 일반적으로 추가하는 위치는 다음 예와 같이 이메일의 바닥글 섹션입니다.

    <div id="footer">{{ unsubscribe_link }} {{ open_tracking_block }}</div>

    사용자 지정 Liquid 코드 예시

    코드 편집기에서 사용자 지정 Liquid 또는 HTML을 추가할 수 있습니다. 다음 코드는 Liquid 코드를 추가하여 이메일 메시지에 스토어 이름, 사용자 지정 버튼, 사용자 지정 크기의 이미지를 표시하는 방법의 예입니다.

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>{{ shop.name }} Newsletter</title>
    </head>
    <body style="margin: 0; padding: 0; font-family: Arial, sans-serif; line-height: 1.5; color: #333333; background-color: #f5f5f5;">
        <table cellpadding="0" cellspacing="0" border="0" width="100%" style="background-color: #f5f5f5;">
            <tr>
                <td align="center" style="padding: 20px;">
                    <table cellpadding="0" cellspacing="0" border="0" width="600" style="background-color: #ffffff; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
                        <!-- Header -->
                        <tr>
                            <td align="center" style="background-color: #4a6de5; padding: 30px 20px; color: #ffffff;">
                                <h1 style="margin: 0; font-size: 28px; font-weight: bold;">{{ shop.name }}</h1>
                                <p style="margin: 10px 0 0; font-size: 16px;">Your Book Journey with Us</p>
                            </td>
                        </tr>
    
                        <!-- Content -->
                        <tr>
                            <td style="padding: 30px 20px;">
                                <!-- Greeting Section -->
                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-bottom: 30px;">
                                    <tr>
                                        <td>
                                            <h2 style="margin: 0 0 15px; font-size: 22px; color: #222222;">Hello {{ customer.name }}!</h2>
                                            <p style="margin: 0 0 15px; font-size: 15px;">We hope this email finds you well. We noticed you're from {{ customer.default_address.city }}.</p>
                                            {% if customer.email %}
                                                <p style="margin: 0 0 15px; font-size: 15px;">Your registered email is: {{ customer.email }}</p>
                                            {% endif %}
                                        </td>
                                    </tr>
                                </table>
    
                                <!-- Reading Journey Section -->
                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-bottom: 30px;">
                                    <tr>
                                        <td>
                                            <h2 style="margin: 0 0 15px; font-size: 20px; color: #4a6de5;">Your Reading Journey</h2>
                                            <p style="margin: 0 0 15px; font-size: 15px;">Thank you for being a loyal customer! Here's a snapshot of your journey:</p>
                                            <p style="margin: 0 0 15px; font-size: 15px;">You purchased {{ customer.orders_count }} books with us.</p>
                                            {% if customer.last_order %}
                                                <p style="margin: 0 0 15px; font-size: 15px;"> You last read {{customer.last_order.line_items[0].title}}. Great choice! </p>
                                              {% endif %}
                                        </td>
                                    </tr>
                                </table>
    
                                <!-- Recommended Books Section -->
                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-bottom: 30px;">
                                    <tr>
                                        <td>
                                            <h2 style="margin: 0 0 15px; font-size: 20px; color: #4a6de5;">Books You Might Love</h2>
                                            <p style="margin: 0 0 15px; font-size: 15px;">Based on your reading preferences, we've handpicked these titles just for you:</p>
    
                                            <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                                <tr>
                                                    <td width="50%" style="padding-right: 10px;">
                                                        <table cellpadding="0" cellspacing="0" border="0" width="100%" style="background-color: #f9f9f9; border-radius: 4px; padding: 15px;">
                                                            <tr>
                                                                <td align="center">
                                                                    <!-- Image with proper email attributes -->
                                                                    <img src="https:{{ all_products['product-1-handle'] | image_url: width: 200 }}"
                                                                         alt="Product 1"
                                                                         width="200"
                                                                         height="200"
                                                                         style="display: block; border: 0; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic;"
                                                                         title="Product 1"
                                                                         border="0">
                                                                    <h3 style="margin: 0 0 10px; font-size: 16px; color: #333333;">{{ all_products['product-1-handle'].title }}</h3>
                                                                    <p style="margin: 0 0 10px; font-size: 15px; color: #4a6de5;">${{ all_products['product-1-handle'].price }}</p>
                                                                    <a href="{{shop.domain}}{{ all_products['product-1-handle'].url }}" style="display: inline-block; background-color: #4a6de5; color: #ffffff; padding: 10px 20px; text-decoration: none; border-radius: 4px; font-size: 14px;">View Book</a>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                    <td width="50%" style="padding-left: 10px;">
                                                        <table cellpadding="0" cellspacing="0" border="0" width="100%" style="background-color: #f9f9f9; border-radius: 4px; padding: 15px;">
                                                            <tr>
                                                                <td align="center">
                                                                    <!-- Image with proper email attributes -->
                                                                    <img src="https:{{ all_products['product-2-handle'] | image_url: width: 200 }}"
                                                                         alt="Product 2"
                                                                         width="200"
                                                                         height="200"
                                                                         style="display: block; border: 0; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic;"
                                                                         title="Product 2"
                                                                         border="0">
                                                                    <h3 style="margin: 0 0 10px; font-size: 16px; color: #333333;">{{ all_products['product-2-handle'].title }}</h3>
                                                                    <p style="margin: 0 0 10px; font-size: 15px; color: #4a6de5;">${{ all_products['product-2-handle'].price }}</p>
                                                                    <a href="{{shop.domain}}{{ all_products['product-2-handle'].url }}" style="display: inline-block; background-color: #4a6de5; color: #ffffff; padding: 10px 20px; text-decoration: none; border-radius: 4px; font-size: 14px;">View Book</a>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
    
                                <!-- Book Club Section -->
                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-bottom: 30px;">
                                    <tr>
                                        <td style="background-color: #f5f7ff; border-radius: 4px; padding: 25px; text-align: center;">
                                            <h2 style="margin: 0 0 15px; font-size: 18px; color: #333333;">This Month's Top Picks</h2>
                                            <p style="margin: 0 0 20px; font-size: 15px;">Discover what other readers are loving this month:</p>
                                            <a href="{{ shop.url }}/pages/book-club" style="display: inline-block; background-color: #4a6de5; color: #ffffff; padding: 10px 20px; text-decoration: none; border-radius: 4px; font-size: 14px;">Join Our Book Club</a>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
    
                        <!-- Footer -->
                        <tr>
                            <td style="background-color: #f2f2f2; padding: 30px 20px; text-align: center;">
                                <p style="margin: 0 0 15px; font-size: 15px;">Best regards,<br><strong>{{ shop.name }} Team</strong></p>
                                <p style="margin: 0 0 15px; font-size: 12px; color: #999999;">© {{ 'now' | date: '%Y' }} {{ shop.name }}. All rights reserved.</p>
                                <p style="margin: 0 0 15px; font-size: 12px;">{{ open_tracking_block }}</p>
                                <a href="{{ unsubscribe_url }}" style="color: #999999; font-size: 12px; text-decoration: underline;">{{ unsubscribe_link }}</a>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </body>
    </html>