このページ:パーソナライゼーションの追加方法や使用可能な日時関数など、E メールデザイナーのコードエディターで生の HTML を書き込みまたは貼り付けてメールコンテンツを作成する方法について説明します。
独自にコーディングを使用すると、Journey Optimizer の E メールデザイナー内で、生の HTML を書き込みまたは貼り付けてメールコンテンツを直接作成できます。 マークアップを完全に制御する必要がある場合や、既存の HTML をインポートする場合は、このモードを使用してください。
HTML のスキルが必要となります。また、このモードを選択すると、コードエディターでの作業となり、ビジュアルエディターに切り替えることはできません。
コードエディターの使用 use-code-editor
コードエディターを使用してメールコンテンツを作成または編集するには、次の手順に従います。
-
E メールデザイナーのホームページで、「独自にコーディング」を選択します。
-
生の HTML コードを入力または貼り付けます。
note NOTE 電子メールをゼロからデザインする場合とは異なり、コードエディターにはプリヘッダー フィールドがありません。 プリヘッダーを定義するには、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: Code your own lets you write or paste raw HTML to build email content directly in the Journey Optimizer Email Designer, add personalization, and work with the date and time functions available in email personalization.
Intents:
- Build email content by entering or pasting raw HTML code after selecting Code your own from the Email Designer home page.
- Use Code your own when you need full control over markup or when importing existing HTML.
- Define a preheader by adding the preheader text directly in your HTML code.
- Use the left pane of the code editor to leverage Journey Optimizer personalization capabilities.
- Clear your email content and start your email from a new design by selecting Change your design from the options menu.
- Check the message design and personalization using test profiles with Preview, then select Save and go back to the message creation screen to finalize your message.
Glossary:
- Code your own (product-specific): The Email Designer mode that lets you write or paste raw HTML to build email content directly in the Journey Optimizer Email Designer.
- Code editor (product-specific): The editor in which you enter or paste your raw HTML code when using Code your own; its left pane gives access to Journey Optimizer personalization capabilities.
- Switch to code editor (product-specific): The option that lets you go back to the code editor from the Email Designer after selecting Change your design.
getCurrentZonedDateTime(): A function that returns the current date and time with time zone information.currentTimeInMillis(): A function that returns the current time in epoch milliseconds.
Guardrails:
- Once you choose Code your own, you stay in the code editor: you cannot switch to the visual editor.
- Unlike when you design your email from scratch, the code editor does not offer a Preheader field.
- Images from Adobe Experience Manager Assets cannot be referenced when using the Code your own method; store images referenced in your HTML code in a public location.
- The personalization editor in the Email Designer has some function limitations compared to journey expressions.
- The
now()function is not supported in the Email Builder’s expression language: it cannot be used within email content or the code editor, while it is available in journey conditions.
Prerequisites and permissions:
- You must have HTML skills to use Code your own.
Terminology:
- Canonical name: Adobe Journey Optimizer — Acronym: AJO — variants: Journey Optimizer
- Canonical name: Adobe Experience Manager — Acronym: AEM
- Do not confuse: “Code your own” ≠ “advanced HTML editor”. The advanced HTML editor in the Email Designer lets you toggle between HTML view and the visual (Desktop) view at any time; with Code your own you stay in the code editor.
FAQ:
- Can I switch from Code your own to the visual editor? No. Once you choose this mode, you stay in the code editor and cannot switch to the visual editor.
- How do I define a preheader when coding my own email content? The code editor does not offer a Preheader field, so add the preheader text directly in your HTML code.
- Can I use the
now()function in email content? No. Thenow()function is not supported in the Email Builder’s expression language and cannot be used within email content or the code editor. - What can I use instead of
now()in email personalization? UsegetCurrentZonedDateTime(), which is the recommended alternative tonow(), orcurrentTimeInMillis(). - Can I reference images from Adobe Experience Manager Assets in my HTML code? No. Store images referenced in your HTML code in a public location.
- How do I clear my email content and start from a new design? Select Change your design from the options menu. This action opens the selected template in the Email Designer, where you can complete the design of your email or go back to the code editor using the Switch to code editor option.
Examples:
getCurrentZonedDateTime()example:{%= getCurrentZonedDateTime() %}returns2024-12-06T17:22:02.281067+05:30[Asia/Kolkata].currentTimeInMillis()example:{%= currentTimeInMillis() %}.- Reference to a pre-calculated date field in email personalization:
{%= profile.timeSeriesEvents._mobile.hotelBookingDetails.bookingDate %}. - Date manipulation with a date value from profile attributes in email personalization:
{%= formatDate(profile.timeSeriesEvents._mobile.hotelBookingDetails.bookingDate, "MM/dd/YY") %}.
Best practices:
getCurrentZonedDateTime()is the recommended alternative tonow()for working with the current date and time in email personalization.- Recommended workaround for date calculations in email content: pre-calculate date fields by calculating the required date values in your data pipeline or profile attributes before sending the email, then reference these pre-calculated values in your personalization.
- Recommended workaround for date calculations in email content: use date/time functions like
dayOfYear()ordiffInDays()with date values from profile attributes. - Recommended workaround for date calculations in email content: create computed attributes that perform complex date calculations, making the results available as profile attributes.
Related pages:
- To open the home page where you select Code your own: Email Designer
- To toggle between HTML view and the visual (Desktop) view instead: Learn more about the advanced HTML editor
- To define a preheader and other email metadata: Learn more about email metadata
- To leverage personalization capabilities in the left pane: Personalize content in Journey Optimizer
- To check the message design and personalization using test profiles: Preview and test your content
- For the images that cannot be referenced with Code your own: Adobe Experience Manager Assets
- For the full list of supported date and time functions: Date and time functions
- To create computed attributes that perform complex date calculations: computed attributes
Personas:
- marketer: Can select Code your own from the Email Designer home page and enter or paste raw HTML code. Can use the left pane to leverage Journey Optimizer personalization capabilities. Can select Change your design from the options menu to clear the email content and start from a new design. Can select Preview to check the message design and personalization using test profiles. Can select Save, then go back to the message creation screen to finalize the message. The page states that once you choose this mode, you stay in the code editor and cannot switch to the visual editor. Where: “Use the code editor”.
Onboarding:
- Level: Intermediate, Experienced
- First minimal step: From the Email Designer home page, select Code your own.