이 페이지에서: Adobe Journey Optimizer 콘텐츠에 직접 복사할 수 있는 날짜, 배열, 문자열, 조건부 논리 및 PQL Edge 사례에 대해 바로 사용할 수 있는 개인화 레시피를 찾아보십시오.
이 페이지에서는 Adobe Journey Optimizer의 가장 일반적인 사용 사례에 대해 즉시 사용 가능한 개인화 패턴을 제공합니다. 모든 예는 개인화 편집기 구문을 사용하며, 이메일, SMS 또는 푸시 콘텐츠에 직접 복사할 수 있습니다.
사용 가능한 함수에 대한 전체 참조는 도우미 함수, 날짜/시간 함수, 문자열 함수 및 배열 함수를 참조하십시오.
날짜 및 시간 레서피 date-time-recipes
레서피 1 — 현재 날짜를 읽을 수 있는 형식으로 표시합니다. recipe-current-date
getCurrentZonedDateTime()과(와) 함께 formatDate을(를) 사용하여 오늘의 날짜를 모든 형식으로 렌더링합니다.
{%= formatDate(getCurrentZonedDateTime(), "MMMM dd, yyyy") %}
출력(예): April 11, 2026
일반적인 형식 패턴:
"dd/MM/yyyy"11/04/2026"MM/dd/yyyy"04/11/2026"EEEE, MMMM dd"Saturday, April 11"yyyy-MM-dd"2026-04-11레서피 2 — 만료 또는 이벤트 날짜의 카운트다운 recipe-countdown
dateDiff을(를) 사용하여 프로필 날짜 특성까지 남은 일수를 계산한 다음 동적으로 렌더링합니다.
출력(예): Your reward points expire in 7 days. Use them before they're gone!
레서피 3 — 동적 종료 일자보다 X일 전 recipe-days-before
프로필 속성(예: 콘텐츠 또는 제목 줄에서 참조)의 X일 전 날짜를 계산하려면 음수 오프셋과 함께 addDays을(를) 사용합니다.
{%= formatDate(addDays(stringToDate(profile.subscription.endDate), -7), "MMMM dd, yyyy") %}
출력(예): April 04, 2026 (4월 11일 7일 전)
고정 시간(예: 오전 9시)도 설정하려면 setHours과(와) 결합하십시오.
{%= formatDate(setHours(addDays(stringToDate(profile.subscription.endDate), -7), 9), "dd/MM/yyyy HH:mm") %}
레서피 4 — 현재 시간을 HH:MM(으)로만 표시 recipe-time-only
extractHours 및 extractMinutes을(를) 사용하여 시간 부분만 표시합니다. 분 동안 앞에 영(0)의 가드를 사용합니다.
출력(예): Your appointment is at 14:05.
레시피 5 - 주말과 평일 비교 감지 recipe-weekend
날짜에 따라 콘텐츠를 조정하려면 dayOfWeek을(를) 사용합니다. 이 함수는 1(월요일)부터 7(일요일)까지 반환합니다. 단일 = 연산자 사용(==이 아닌 PQL 구문):
dayOfWeek()은(는) 날짜에 따라 콘텐츠을(를) 조정하기 위한 것입니다. 여정에서 요일을 기준으로 프로필을 다르게 라우팅하려면 여정 조건 활동에서 기본 제공된 시간 조건 → 요일 옵션을 사용하십시오. 자세히 알아보기배열 및 루프 레서피 array-recipes
레서피 6 — 프로파일 배열의 모든 항목 나열 recipe-list-items
{{#each}}을(를) 사용하여 프로필 배열을 반복하고 각 항목을 렌더링합니다. 이는 개인화 편집기(이메일, SMS, 푸시)에서만 사용할 수 있습니다.
출력(예):
- Running shoes: 89€
- Water bottle: 15€
- Gym bag: 45€
{{#each}}은(는) 여정 조건 활동에서 지원되지 않습니다. 조건에서 배열 필터링을 수행하려면 컬렉션 관리 함수를 사용하십시오.레서피 7 — 가격별로 배열의 상위 N개 항목 표시 recipe-first-n
숫자 필드를 기준으로 상위 N개 항목을 정렬하고 검색하려면 topN을(를) 사용하십시오. topN이(가) PQL 함수이므로 먼저 {% let %}을(를) 사용하여 변수에 할당한 다음 {{#each}}을(를) 사용하여 반복하십시오.
topN(profile.orders, price, 3)은(는) price별로 순서를 내림차순으로 정렬하고 상위 3을 반환합니다. 즉, 원래 배열 순서의 처음 3개 항목을 반환하지 않습니다.또는 head을(를) 사용하여 단일 상위 항목만 가져옵니다.
{%= head(profile.purchases.recentItems).name %}
레서피 8 — 배열 항목당 조건부로 컨텐츠 렌더링 recipe-conditional-loop
{{#each}} 내의 {%#if%}을(를) 사용하여 일치하는 항목에 대해서만 출력을 렌더링합니다. PQL 평가기가 다음 조건에서 특성 참조를 확인할 수 있도록 as |order|을(를) 사용하여 루프 별칭을 정의하십시오.
this.status은(는) Handlebars 식에서 작동하지만 {%#if%} 내의 PQL 평가기에서 확인되지 않습니다. 명명된 루프 별칭(예: order)을 사용하면 Handlebars 및 PQL 컨텍스트 모두에서 특성을 사용할 수 있습니다.문자열 및 형식 지정 레서피 string-recipes
레서피 9 — replaceAll로 문자열을 지우고 재사용합니다. recipe-replaceall-reuse
replaceAll이(가) 새 값을 반환합니다. 원본을 수정하지 않습니다. 함수 호출을 반복하지 않고 결과를 저장하고 여러 번 참조하려면 {% let %}을(를) 사용하십시오.
출력(예):
Hi John,
Your exclusive code is: WELCOME-JOHN
레서피 10 — JSON 출력의 값 큰따옴표 recipe-json-quotes
문자열 내에 리터럴 큰따옴표를 포함하려면(예: 사용자 지정 페이로드에 대해 JSON 생성) 백슬래시(\")로 이스케이프 처리하십시오.
출력: { "greeting": "Hello \"John\"" }
레시피 11 — 날짜 구성 요소의 서식을 대문자로 지정합니다 recipe-uppercase-date
formatDate을(를) upperCase과(와) 결합하여 월 또는 일 이름을 대문자로 렌더링합니다.
{%= upperCase(formatDate(getCurrentZonedDateTime(), "MMMM")) %}
출력(예): APRIL
전체 대문자 날짜 문자열:
{%= upperCase(formatDate(profile.person.birthDateTime, "EEEE MMMM dd yyyy")) %}
출력(예): WEDNESDAY JANUARY 01 2020
조건부 논리 레시피 conditional-recipes
레시피 12 — 개인화된 콘텐츠의 경우/경우/경우/경우 recipe-if-elseif
다중 분기 조건부 논리에 {%#if%}, {%else if%} 및 {%else%}을(를) 사용합니다. 이 패턴은 이메일 콘텐츠 및 조각에서 작동합니다.
레서피 13 — Null 안전 속성 표시 recipe-null-safe
프로필 속성이 null이거나 누락된 경우 빈 값을 렌더링하지 않도록 하려면 조건부 폴백을 사용합니다.
또는 isEmpty을(를) 사용하여 삼항 스타일 패턴으로 인라인합니다.
PQL edge case 레서피 pql-edge-cases
레서피 14 — 하이픈이 연결된 속성 키 참조 recipe-hyphenated-key
XDM 스키마 필드 이름에 하이픈(예: order-total, event-type)이 포함된 경우 하이픈을 빼기 연산자로 해석하지 않도록 PQL 식 내에서 백틱으로 줄바꿈합니다.
{%= profile.events.`order-total` > 100 %}
{%= ... %}) 내에서만 지원됩니다. 일반 Handlebars 보간({{...}})에서 허용되지 않습니다. 하이픈이 있는 필드 값을 직접 렌더링해야 하는 경우 먼저 PQL 식을 통해 계산하거나 {% let %}을(를) 사용하여 변수에 저장하십시오.레서피 15 — 컨텍스트 속성에서 숫자 이벤트 ID를 참조합니다. recipe-numeric-event-id
ID가 숫자 문자열인 여정 컨텍스트 이벤트를 사용하는 경우(예: 1697323153) 백틱으로 ID를 래핑하고 toDateTime() 및 formatDate()과(와) 함께 {% let %}을(를) 사용합니다.
출력(예): Your appointment: 18/03/2026 14:30
레서피 16 — 입력 강제 변환: 문자열 필드를 숫자와 비교 recipe-type-coercion
PQL은 강력한 형식입니다. 프로필 필드가 문자열로 저장되었지만 숫자로 비교해야 하는 경우 먼저 stringToNumber()을(를) 사용하여 변환하십시오.
{%= stringToNumber(profile.loyalty.pointsBalance) > 500 %}
문자열로 저장된 부울 필드의 경우:
{%= toBool(profile.consents.email.val) = true %}
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 provides 16 ready-to-use copy-paste personalization recipes covering dates, arrays, strings, conditional logic, and PQL edge cases for use in Journey Optimizer email, SMS, and push content.
Intents:
- Copy ready-to-use date/time patterns (current date, countdown, offset dates, time display, weekend detection)
- Copy array and loop patterns (list items, top N items, conditional per-item rendering)
- Copy string formatting patterns (clean and reuse strings, JSON quoting, uppercase date components)
- Copy conditional logic patterns (multi-branch if/elseif/else, null-safe attribute display)
- Handle PQL edge cases (hyphenated keys, numeric event IDs, type coercion)
Glossary:
- Personalization recipe: A ready-to-use copy-paste pattern for a common personalization use case, using personalization editor syntax. (product-specific)
formatDate: A function that converts a date to a string using a specified format pattern (e.g."MMMM dd, yyyy").dateDiff: A function that computes the numeric difference between two dates.getCurrentZonedDateTime(): A function returning the current date and time in a time-zone-aware format.topN: A PQL function that sorts an array by a specified numeric field in descending order and returns the top N items. Must be assigned via{% let %}before use in a Handlebars loop.{% let %}: Handlebars variable assignment syntax for storing computed values; required when a PQL function result needs to be referenced in a subsequent Handlebars context.replaceAll: A string function that replaces all occurrences of a pattern in a string; returns a new string without modifying the original.
Guardrails:
{{#each}}is not supported in the journey condition activity; use collection management functions for array filtering in journey conditions.- Backtick escaping for hyphenated attribute keys is only supported inside PQL expressions (
{%= ... %}); backticks are not accepted in plain Handlebars interpolation ({{...}}). topNis a PQL function and must be assigned to a{% let %}variable before being used as a{{#each}}loop target.- When using a loop variable inside a
{%#if%}block, declare a named loop alias (e.g.as |order|);this.statusis not resolved by the PQL evaluator inside{%#if%}. - Use lowercase
yinformatDatepatterns for calendar year;Y(week-based year) may produce unexpected values at year-end boundaries.
Terminology:
- Canonical name: personalization recipe — variants: pattern, template, example, copy-paste pattern
- Do not confuse:
{%= ... %}(PQL expression syntax — evaluated, returns a computed value) ≠{{...}}(Handlebars interpolation — renders a variable or template expression) - Do not confuse:
{%#if%}/{%/if%}(Journey Optimizer conditional syntax, percent-curly braces) ≠{{#if}}/{{/if}}(standard Handlebars conditional syntax) - Do not confuse:
topN(array, field, n)(sorts by field descending, returns top N) ≠head(array)(returns only the first item from the array) - Do not confuse:
dayOfWeek()(used in message content to adapt display based on day) ≠ the journey Time condition “Day of the week” option (used in the journey Condition activity to route profiles differently) - Do not confuse: date format pattern
y(calendar year — correct) ≠Y(week-based year — may produce unexpected results at year boundaries)
FAQ:
- Q: What is the difference between
{%= ... %}and{{...}}in personalization? —{%= ... %}is PQL expression syntax — it is evaluated and returns a computed value (number, string, boolean).{{...}}is Handlebars interpolation — it renders a variable or template expression. Both appear in personalization content but serve different purposes. - Q: How do I use a PQL function result inside a Handlebars
{{#each}}loop? — Assign the PQL function result to a variable using{% let variableName = pqlFunction(...) %}, then use{{#each variableName}}to iterate over it. - Q: Can
{{#each}}be used in a journey condition activity? — No.{{#each}}is available only in message personalization content (email, SMS, push). For array filtering in journey conditions, use collection management functions. - Q: How do I reference a field whose name contains a hyphen? — Wrap the hyphenated key in backticks inside a PQL expression:
{%= profile.events.`order-total` > 100 %}. Backticks are not supported in plain Handlebars interpolation — use a{% let %}variable as an intermediate step if needed. - Q: Why does
topNneed{% let %}before a{{#each}}loop? —topNis a PQL function that returns a PQL list. Assigning it to a{% let %}variable makes the result available in the Handlebars context so it can be iterated with{{#each}}.