Personalization 사용 사례: 장바구니 포기 이메일 personalization-use-case-helper-functions

이 페이지에서: upperCase를 사용하여 전자 메일 본문을 개인화하는 장바구니 포기 사용 사례를 팔로우합니다. 각 사례는 Adobe Journey Optimizer에서 도우미 기능을 수행하는 경우입니다.

이 예제에서는 이메일 메시지의 본문을 개인화합니다. 이 메시지는 장바구니에 품목을 남겨두었지만 구매를 완료하지 않은 고객을 타겟팅합니다.

다음 유형의 도우미 함수를 사용합니다.

  • 고객의 이름을 대문자로 삽입하는 upperCase 문자열 함수입니다. 자세히 알아보기.
  • each 도우미가 장바구니에 있는 항목을 나열합니다. 자세히 알아보기.
  • 관련 제품이 장바구니에 있는 경우 제품별 메모를 삽입하려면 if 도우미를 사용하십시오. 자세히 알아보기.

➡️ 이 비디오에서 도우미 함수를 사용하는 방법에 대해 알아보세요

시작하기 전에 다음 요소를 구성하는 방법을 알고 있어야 합니다.

다음 단계를 수행하십시오.

1단계: 초기 이벤트 및 관련 여정 만들기 create-context

장바구니 콘텐츠는 여정의 컨텍스트 정보입니다. 따라서 여정 관련 정보를 이메일에 추가하려면 먼저 초기 이벤트와 이메일을 장바구니에 추가해야 합니다.

  1. 스키마에 productListItems 배열이 포함된 이벤트를 만듭니다.

  2. 이 배열의 모든 필드를 이 이벤트의 페이로드 필드로 정의합니다.

    Adobe Experience Platform 설명서에서 제품 목록 항목 데이터 형식에 대해 자세히 알아보세요.

  3. 이 이벤트로 시작하는 여정을 만듭니다.

  4. 전자 메일 활동을 여정에 추가합니다.

    흐름에서 이벤트 및 전자 메일 활동이 있는 캔버스 여정

2단계: 이메일 만들기 configure-email

  1. 전자 메일 활동에서 콘텐츠 편집​을 클릭한 다음 전자 메일 Designer​을 클릭합니다.

    콘텐츠 편집 및 이메일 Designer 옵션을 사용하여 이메일 활동

  2. 이메일 Designer 홈 페이지의 왼쪽 팔레트에서 3개의 구조 구성 요소를 메시지 본문으로 끌어서 놓습니다.

  3. HTML 콘텐츠 구성 요소를 각 새 구조 구성 요소로 끌어다 놓습니다.

    본문에서 3개의 구조 구성 요소와 HTML 콘텐츠 구성 요소가 있는 Designer에 전자 메일을 보냅니다

3단계: 고객의 이름을 대문자로 삽입 uppercase-function

  1. 이메일 Designer 홈 페이지에서 고객의 이름을 추가하려는 HTML 구성 요소를 클릭합니다.

  2. 상황별 도구 모음에서 소스 코드 표시​를 클릭합니다.

    소스 코드 표시 옵션이 있는 상황별 도구 모음

  3. HTML 편집 창에서 upperCase 문자열 함수를 추가합니다.

    1. 왼쪽 메뉴에서 도우미 함수​를 선택합니다.

    2. 검색 필드를 사용하여 "대문자"를 찾습니다.

    3. 검색 결과에서 upperCase 함수를 추가합니다. 이렇게 하려면 {%= upperCase(string) %}: string 옆에 있는 더하기(+) 기호를 클릭합니다.

      표현식 편집기에는 다음 표현식이 표시됩니다.

      code language-handlebars
      {%= upperCase(string) %}
      

      도우미 함수에서 upperCase 함수가 선택된 식 편집기

  4. 표현식에서 “문자열” 자리 표시자를 제거합니다.

  5. 이름 토큰 추가:

    1. 왼쪽 메뉴에서 프로필 특성​을 선택합니다.

    2. 사용자 > 전체 이름​을 선택합니다.

    3. 이름 토큰을 식에 추가하십시오.

      표현식 편집기에는 다음 표현식이 표시됩니다.

      code language-handlebars
      {%= upperCase(profile.person.name.firstName) %}
      

      프로필 이름 토큰이 있는 upperCase를 표시하는 식 편집기

      Adobe Experience Platform 설명서에서 사용자 이름 데이터 유형에 대해 자세히 알아보세요.

  6. 유효성 검사​를 클릭한 다음 저장​을 클릭합니다.

    유효성 검사 및 저장 단추가 있는 HTML 창 편집

  7. 메시지를 저장합니다.

4단계: 장바구니에서 항목 목록 삽입 each-helper

이 단계에서는 이벤트 데이터를 반복합니다. 다른 데이터 소스(이벤트, 사용자 지정 작업 응답 및 기타 컨텍스트 데이터)를 반복하는 포괄적인 예제는 Handlebars를 사용하여 컨텍스트 데이터 반복을 참조하십시오.

  1. 메시지 콘텐츠를 다시 엽니다.

  2. 이메일 Designer 홈 페이지에서 장바구니 콘텐츠를 나열할 HTML 구성 요소를 클릭합니다.

  3. 상황별 도구 모음에서 소스 코드 표시​를 클릭합니다.

    소스 코드 표시 옵션이 있는 상황별 도구 모음

  4. HTML 편집 창에서 each 도우미를 추가합니다.

    1. 왼쪽 메뉴에서 도우미 함수​를 선택합니다.

    2. 검색 필드를 사용하여 "각각"을 찾습니다.

    3. 검색 결과에서 each 도우미를 추가합니다.

      표현식 편집기에는 다음 표현식이 표시됩니다.

      code language-handlebars
      {{#each someArray as |variable|}} {{/each}}
      

      각 도우미 템플릿이 있는 식 편집기

  5. 식에 productListItems 배열을 추가합니다.

    1. 표현식에서 “someArray” 자리 표시자를 제거합니다.

    2. 왼쪽 메뉴에서 컨텍스트 특성​을 선택합니다.

      컨텍스트 특성​은(는) 여정 컨텍스트가 메시지에 전달된 후에만 사용할 수 있습니다.

    3. Journey Optimizer > 이벤트 > event_name​을 선택한 다음 productListItems 노드를 확장합니다.

      이 예제에서 event_name​은 이벤트의 이름을 나타냅니다.

    4. Product 토큰을 식에 추가하십시오.

      표현식 편집기에는 다음 표현식이 표시됩니다.

      code language-handlebars
      {{#each context.journey.events.event_ID.productListItems.product as |variable|}} {{/each}}
      

      이 예제에서 event_ID​은 이벤트의 ID를 나타냅니다.

      상황별 특성에 productListItems가 있는 식 편집기

    5. 표현식을 수정합니다.

      1. “.product” 문자열을 제거합니다.
      2. “variable” 자리 표시자를 "product"로 바꿉니다.

      다음 예에서는 수정된 표현식을 보여 줍니다.

      code language-handlebars
      {{#each context.journey.events.event_ID.productListItems as |product|}}
      
  6. 여는 {{#each}} 태그와 닫는 {{/each}} 태그 사이에 이 코드를 붙여 넣습니다.

    code language-html
    <table>
       <tbody>
          <tr>
             <td><b>#name</b></td>
             <td><b>#quantity</b></td>
             <td><b>$#priceTotal</b></td>
          </tr>
       </tbody>
    </table>
    
  7. 품목명, 수량 및 가격에 대한 개인화 토큰을 추가합니다.

    1. HTML 표에서 자리 표시자 "#name"를 제거합니다.
    2. 이전 검색 결과에서 Name 토큰을 식에 추가하십시오.

    다음 단계를 두 번 반복합니다.

    • 자리 표시자 "#quantity"을 수량 토큰으로 바꾸십시오.
    • 자리 표시자 "#priceTotal"을 총 가격 토큰으로 바꾸십시오.

    다음 예에서는 수정된 표현식을 보여 줍니다.

    code language-handlebars
    {{#each context.journey.events.event_ID.productListItems as |product|}}
       <table>
          <tbody>
             <tr>
             <td><b>{{product.name}}</b></td>
             <td><b>{{product.quantity}}</b></td>
             <td><b>${{product.priceTotal}}</b></td>
             </tr>
          </tbody>
       </table>
    {{/each}}
    
  8. 유효성 검사​를 클릭한 다음 저장​을 클릭합니다.

    각 블록을 구성한 후 유효성 검사 및 저장이 포함된 식 편집기

5단계: 제품별 참고 사항 삽입 if-helper

  1. 이메일 Designer 홈 페이지에서 메모를 삽입하려는 HTML 구성 요소를 클릭합니다.

  2. 상황별 도구 모음에서 소스 코드 표시​를 클릭합니다.

    소스 코드 표시 옵션이 있는 상황별 도구 모음

  3. HTML 편집 창에서 if 도우미를 추가합니다.

    1. 왼쪽 메뉴에서 도우미 함수​를 선택합니다.

    2. 검색 필드를 사용하여 "if"를 찾습니다.

    3. 검색 결과에서 if 도우미를 추가합니다.

      표현식 편집기에는 다음 표현식이 표시됩니다.

      code language-handlebars
      {%#if condition1%} render_1
         {%else if condition2%} render_2
         {%else%} default_render
      {%/if%}
      

      if helper 템플릿이 포함된 식 편집기

  4. 표현식에서 이 조건 제거:

    code language-handlebars
    {%else if condition2%} render_2
    

    다음 예에서는 수정된 표현식을 보여 줍니다.

    code language-handlebars
    {%#if condition1%} render_1
       {%else%} default_render
    {%/if%}
    
  5. 조건에 제품 이름 토큰을 추가합니다.

    1. 표현식에서 “condition1” 자리 표시자를 제거합니다.

    2. 왼쪽 메뉴에서 컨텍스트 특성​을 선택합니다.

    3. Journey Orchestration > 이벤트 > event_name​을 선택한 다음 productListItems 노드를 확장합니다.

      이 예제에서 event_name​은 이벤트의 이름을 나타냅니다.

    4. Name 토큰을 식에 추가합니다.

      표현식 편집기에는 다음 표현식이 표시됩니다.

      code language-handlebars
      {%#if context.journey.events.`event_ID`.productListItems.name%}
         render_1
         {%else%} default_render
      {%/if%}
      

      if 조건에 productListItems 이름 토큰이 있는 식 편집기

  6. 표현식을 수정합니다.

    1. 표현식 편집기에서 name 토큰 뒤에 제품 이름을 지정합니다.

      이 구문을 사용하십시오. 여기서 product_name​은(는) 제품 이름을 나타냅니다.

      code language-javascript
      = "product_name"
      

      이 예에서 제품 이름은 "Juno Jacket"입니다.

      code language-handlebars
      {%#if context.journey.events.`event_ID`.productListItems.name = "Juno Jacket" %}
         render_1
         {%else%} default_render
      {%/if%}
      
    2. “render_1” 자리 표시자를 메모의 텍스트로 바꿉니다.

      예:

      code language-handlebars
      {%#if context.journey.events.`event_ID`.productListItems.name = "Juno Jacket" %}
         Due to longer than usual lead times on the Juno Jacket, please expect item to ship two weeks after purchase.
         {%else%} default_render
      {%/if%}
      
    3. 표현식에서 “default_render” 자리 표시자를 제거합니다.

  7. 유효성 검사​를 클릭한 다음 저장​을 클릭합니다.

    if 블록 구성 후 유효성 검사 및 저장으로 HTML 창 편집

  8. 메시지를 저장합니다.

6단계: 여정 테스트 및 게시 test-and-publish

  1. 테스트 토글을 켜고 이벤트 트리거​를 클릭합니다.

    테스트 토글 및 이벤트 트리거 단추가 있는 여정

  2. 이벤트 구성 창에서 입력 값을 입력한 다음 보내기​를 클릭합니다.

    테스트 모드는 테스트 프로필에서만 작동합니다.

    입력 값 및 전송 단추가 있는 이벤트 구성 창

    이메일은 테스트 프로필의 주소로 전송됩니다.

    이 제품은 장바구니에 들어 있으므로 이 이메일에는 Juno Jacket에 대한 메모가 포함되어 있습니다.

    메시지 본문에 Juno Jacket 배송 메모를 표시하는 샘플 전자 메일

  3. 오류가 없는지 확인한 다음 여정을 게시합니다.

Handlebars 함수 handlebars

사용 사례 use-case

사용 방법 비디오 video

도우미 함수를 사용하는 방법에 대해 알아봅니다.

AI Knowledge Reference

This section contains structured knowledge intended to support interpretation, retrieval, and question answering related to this topic.

For complete understanding, this information should be combined with the documentation on this page. Neither source is intended to stand alone; the page describes the feature, while this section provides additional context that helps disambiguate terminology, intent, applicability, and constraints.

  • TL;DR: This page walks through a cart abandonment email use case using three helper functions — upperCase, each, and if — to display a customer’s first name in capitals, list cart items, and insert a product-specific shipping note conditionally.

Intents:

  • Create a journey event whose schema includes the productListItems array
  • Insert a customer’s first name in uppercase using {%= upperCase(profile.person.name.firstName) %}
  • List cart items by iterating over context.journey.events.event_ID.productListItems with {{#each}}
  • Display a product-specific note conditionally using {%#if context.journey.events.\event_ID`.productListItems.name = “product_name” %}`
  • Test the journey in test mode using a test profile with event payload, then publish

Glossary:

  • upperCase: A PQL string function that converts a string to uppercase; called with {%= upperCase(string) %}. (product-specific)
  • each helper: A Handlebars block helper ({{#each array as |alias|}} ... {{/each}}) that iterates over an array such as productListItems. (product-specific)
  • if helper: A conditional block helper ({%#if condition%} ... {%else%} ... {%/if%}) that renders content only when the specified condition is true.
  • productListItems: A standard XDM array representing cart contents, with fields including name, quantity, and priceTotal. (product-specific)
  • Test mode: A journey feature that enables sending test messages to test profile addresses to verify journey and message behavior before publication. (product-specific)

Guardrails:

  • Contextual attributes (including journey event data) are available in the personalization editor only after the message has been placed inside a journey that includes the relevant event.
  • Test mode works only with test profiles.

Terminology:

  • Canonical name: cart abandonment email — variants: cart abandonment use case
  • Do not confuse: context.journey.events.event_ID.productListItems (event-sourced array, accessed via Contextual attributes) ≠ profile.* attributes (profile-sourced, always available)

FAQ:

  • Q: What helper functions are used in this use case? — Three: upperCase (renders first name in capitals), each (iterates over the cart items array), and if (conditionally displays a product-specific shipping note).
  • Q: Where does the cart item data come from in the personalization expression? — From the journey event’s productListItems array, accessed via Contextual attributes at context.journey.events.event_ID.productListItems.
  • Q: Can contextual attributes be used before placing the message inside a journey? — No. Contextual attributes are available in the personalization editor only after the message is placed inside a journey that includes the relevant event.
  • Q: How do I test the email with cart data? — Turn on the Test toggle in the journey, click Trigger an event, and enter the input values in the Event configuration window, then click Send. The email is sent to the test profile’s address.
recommendation-more-help
journey-optimizer-help