Code your own content code-content

Use the Code your own mode to import raw HTML and/or code your email content. This method requires HTML skills.

➡️ Discover this feature in video

CAUTION
Images from Adobe Experience Manager Assets cannot be referenced when using this method. The images referenced in your HTML code must be stored into a public location.
  1. From the Email Designer home page, select Code your own.

  2. Enter or paste your raw HTML code.

  3. Use the left pane to leverage Journey Optimizer personalization capabilities. Learn more

    note note
    NOTE
    The personalization editor in the Email Designer has some function limitations compared to journey expressions. Learn more about date/time function limitations
  4. If you want to clear your email content and start your email from a new design, select Change your design from the options menu.

    note note
    NOTE
    This action opens the selected template in the Email Designer. From there, you can either complete the design of your email, or go back to the code editor using the Switch to code editor option.
  5. Click the Preview button to check the message design and personalization using test profiles. Learn more

  6. Once your code is ready, click Save then go back to the message creation screen to finalize your message.

Date and time function limitations date-time-limitations

When using personalization in the Email Designer code editor, the now() function is not available for dynamic date calculations.

IMPORTANT
The now() function is not supported in the Email Builder’s expression language. While now() is available in journey conditions, it cannot be used within email content or the code editor.

Available alternatives:

Use the following functions to work with current date and time in email personalization:

  • getCurrentZonedDateTime() - Returns the current date and time with time zone information. This is the recommended alternative to now().

    Example: {%= getCurrentZonedDateTime() %} returns 2024-12-06T17:22:02.281067+05:30[Asia/Kolkata]

  • currentTimeInMillis() - Returns current time in epoch milliseconds.

    Example: {%= currentTimeInMillis() %}

Recommended workarounds:

If you need to perform date calculations in your email content:

  • Pre-calculate date fields - Calculate required date values in your data pipeline or profile attributes before sending the email, then reference these pre-calculated values in your personalization.

    Example: {%= profile.timeSeriesEvents._mobile.hotelBookingDetails.bookingDate %}

  • Use date manipulation functions - Use date/time functions like dayOfYear() or diffInDays() with date values from profile attributes.

    Example: {%= formatDate(profile.timeSeriesEvents._mobile.hotelBookingDetails.bookingDate, "MM/dd/YY") %}

  • Use computed attributes - Create computed attributes that perform complex date calculations, making the results available as profile attributes.

Learn more about Date Time Functions in personalization.

recommendation-more-help
b22c9c5d-9208-48f4-b874-1cefb8df4d76