このページ:パーソナライゼーションの追加方法や使用可能な日時関数など、E メールデザイナーのコードエディターで生の HTML を書き込みまたは貼り付けてメールコンテンツを作成する方法について説明します。
独自にコーディングを使用すると、Journey Optimizer の E メールデザイナー内で、生の HTML を書き込みまたは貼り付けてメールコンテンツを直接作成できます。 マークアップを完全に制御する必要がある場合や、既存の HTML をインポートする場合は、このモードを使用してください。
HTML のスキルが必要となります。また、このモードを選択すると、コードエディターでの作業となり、ビジュアルエディターに切り替えることはできません。
コードエディターの使用 use-code-editor
コードエディターを使用してメールコンテンツを作成または編集するには、次の手順に従います。
-
E メールデザイナーのホームページで、「独自にコーディング」を選択します。
-
Raw HTML コードを入力または貼り付けます。
-
左側のペインを使用して、Journey Optimizer パーソナライゼーション機能を利用します。 詳細情報
note NOTE E メールデザイナーのパーソナライゼーションエディターには、ジャーニー式と比較して、いくつかの関数制限があります。 日時関数の制限の詳細情報 -
メールの内容をクリアして新しいデザインからメールを開始する場合は、オプション メニューから「デザインを変更」を選択します。
note NOTE このアクションにより、E メールデザイナーで選択したテンプレートが開きます。 ここから、メールのデザインを完成させるか、「コードエディターに切り替え」オプションを使用してコードエディターに戻ることができます。 -
「プレビュー」ボタンをクリックし、テストプロファイルを使用したメッセージデザインとパーソナライゼーションを確認します。 詳細情報
-
コードの準備が整ったら、「保存」をクリックし、メッセージ作成画面に戻ってメッセージを完成させます。
日時関数の制限 date-time-limitations
E メールデザイナーのコードエディターでパーソナライゼーションを使用する際、now() 関数は動的な日付計算には使用できません。
now() 関数は、メールビルダーの式言語ではサポートされていません。 now() はジャーニー条件で使用できますが、メールコンテンツやコードエディター内では使用できません。使用可能な代替手段:
メールのパーソナライゼーションで現在の日時を操作するには、以下の関数を使用します。
-
getCurrentZonedDateTime()- タイムゾーン情報を含む現在の日時を返します。now()の代わりに使用することをお勧めします。例:
{%= getCurrentZonedDateTime() %}は、2024-12-06T17:22:02.281067+05:30[Asia/Kolkata]を返します -
currentTimeInMillis()- 現在の時刻をエポックミリ秒単位で返します。例:
{%= currentTimeInMillis() %}
推奨される回避策:
メールコンテンツで日付計算を実行する必要がある場合:
-
日付フィールドを事前計算 - メールを送信する前に、データパイプラインまたはプロファイル属性で必要な日付値を計算し、パーソナライゼーションでこれらの事前計算値を参照します。
例:
{%= profile.timeSeriesEvents._mobile.hotelBookingDetails.bookingDate %} -
日付操作関数を使用 - プロファイル属性の日付値に対して、
dayOfYear()やdiffInDays()などの日時関数を使用します。例:
{%= formatDate(profile.timeSeriesEvents._mobile.hotelBookingDetails.bookingDate, "MM/dd/YY") %} -
計算属性を使用 - 複雑な日付計算を実行する計算属性を作成し、その結果をプロファイル属性として使用できるようにします。
サポートされている関数の完全なリストについて詳しくは、日時関数を参照してください。
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 explains how to use the Code your own mode to write or paste raw HTML in the Email Designer code editor to build email content, add personalization, and work with date and time using the available functions and workarounds.
Intents:
- Write or paste raw HTML to build email content using Code your own
- Add personalization using the left pane of the code editor
- Preview the message design and personalization using test profiles
- Clear content and start a new design with Change your design
- Work with current date and time using available functions and recommended workarounds
Glossary:
- Code your own: A mode to write or paste raw HTML to build email content directly in the Email Designer; once chosen, you stay in the code editor and cannot switch to the visual editor (product-specific)
- Advanced HTML editor: A different feature that lets you toggle between HTML view and the visual (Desktop) view at any time; not the same as Code your own (product-specific)
getCurrentZonedDateTime(): Returns the current date and time with time zone information; the recommended alternative tonow()(product-specific)currentTimeInMillis(): Returns current time in epoch milliseconds (product-specific)
Guardrails:
- You must have HTML skills; once you choose Code your own, you stay in the code editor and cannot switch to the visual editor.
- The
now()function is not supported in the Email Builder’s expression language; while available in journey conditions, it cannot be used within email content or the code editor. - The personalization editor in the Email Designer has some function limitations compared to journey expressions.
- Images from Adobe Experience Manager Assets cannot be referenced when using Code your own; store referenced images in a public location.
Terminology:
- Canonical name: Code your own — Acronym: n/a — variants: code editor, code your own content
- Synonyms: “Code your own” = “code editor mode”
- Do not confuse: “Code your own” (code editor only, no switch to visual editor) ≠ “advanced HTML editor” (toggles between HTML view and visual Desktop view)
FAQ:
- Q: Can I switch from the code editor to the visual editor? — No; once you choose Code your own, you stay in the code editor. (The separate advanced HTML editor does allow toggling between HTML and Desktop views.)
- Q: Can I use
now()in email content or the code editor? — No;now()is not supported in the Email Builder’s expression language, though it is available in journey conditions. UsegetCurrentZonedDateTime()(recommended) orcurrentTimeInMillis(). - Q: Can I reference AEM Assets images in Code your own? — No; store images referenced in your HTML code in a public location.
- Q: How can I perform date calculations in email content? — Pre-calculate date fields in your data pipeline or profile attributes, use date manipulation functions with profile date values, or use computed attributes.