{{ journey.first_event.properties.details.first.manufacturer }} = Company A{{ journey.first_event.properties.details.last.manufacturer }} = Company B{{ journey.first_event.properties.details[0].manufacturer }} = Company A{{ journey.first_event.properties.details[1].manufacturer }} = Company B
잘못된 Liquid 구문이나 누락된 속성은 빈 문자열로 렌더링됩니다. 메시지는 그대로 전송됩니다. default 필터를 사용하여 대체 값을 설정하세요.
3
Journey 생성
Custom Event를 진입 규칙 및/또는 Wait Until 조건으로 사용하도록 Journey를 설정합니다.
Messages > Templates > New Email Template로 이동하여 드래그 앤 드롭 에디터를 엽니다.
2
레이아웃 구조 추가
5개의 행을 생성합니다:
행 1, 2, 4: Paragraph 블록이 포함된 1열
행 3: HTML | Paragraph | Paragraph | Paragraph가 포함된 4열
행 5: Button 블록이 포함된 1열
장바구니 이탈용 기본 이메일 템플릿
3
상품 수 표시
행 1에 다음을 추가합니다:
Liquid
We're holding onto {{journey.first_event.properties.cart.size}} items in your cart, but don't wait too long!
문법적으로 더 정확하게 하려면 조건문을 사용하여 “1 item”과 “2 items”를 구분할 수 있지만, 장바구니 이탈 이메일에서는 복수형을 사용해도 일반적으로 문제가 없습니다.
Liquid
{% assign cart = message.custom_data.cart %}{% assign item_count = cart.size | plus: 0 %}{% if item_count == 1 %}We're holding onto {{item_count}} item in your cart, but don't wait too long, other squirrels are getting ahead!{% endif %}{% if item_count > 1 %}We're holding onto {{item_count}} items in your cart, but don't wait too long, other squirrels are getting ahead!{% endif %}
4
for 루프 시작
for 루프를 사용하여 각 장바구니 항목에 대해 제품 표시 행을 반복합니다.행 2(루프 시작)에 다음을 추가합니다:
Liquid
{% for product in journey.first_event.properties.cart %}
이 코드의 역할:
cart 배열의 각 객체를 반복하는 루프를 시작합니다
현재 항목을 나타내는 임시 변수 product를 생성합니다
{% for %}와 {% endfor %} 사이의 모든 내용이 각 장바구니 항목마다 반복됩니다
product는 원하는 이름으로 변경할 수 있습니다(예: item, cartItem). 일관성만 유지하면 됩니다
for 루프 배치: {% for %} 구문은 반드시 별도의 텍스트 블록 행에 배치해야 합니다. 다른 콘텐츠가 포함된 다중 열 행 안에 넣지 마세요. 일부 이메일 클라이언트에서 렌더링이 깨질 수 있습니다.
5
제품 상세 정보 표시
이 4열 행은 이미지, 이름, 수량, 가격을 표시합니다. 루프 내부에 있으므로 모든 장바구니 항목에 대해 반복됩니다.행 3(제품 상세 정보)에서 다음을 구성합니다:열 1 - HTML 블록 (제품 이미지):
Push 알림은 공간이 제한되어 있으므로, 하나의 항목을 표시하고 전체 수량을 언급합니다.메시지 필드:조건문을 사용하여 올바른 문법으로 항목과 수량을 표시합니다.
Liquid
{% assign cart = journey.first_event.properties.cart %}{% assign item_count = cart.size | plus: 0 %}{% if item_count == 1 %}You left {{cart.first.product_name}} in your cart.{% endif %}{% if item_count == 2 %}You left {{cart.first.product_name}} and {{item_count | minus: 1}} more item in your cart.{% endif %}{% if item_count > 2 %}You left {{cart.first.product_name}} and {{item_count | minus: 1}} more items in your cart.{% endif %}