Code your own content code-content
Code your own lets you write or paste raw HTML to build email content directly in the Journey Optimizer Email Designer. Use this mode when you need full control over markup or when importing existing HTML.
You must have HTML skills, and once you choose this mode, you stay in the code editor—you cannot switch to the visual editor.
➡️ Discover this feature in video
Use the code editor use-code-editor
To create or edit email content using the code editor, follow these steps.
-
From the Email Designer home page, select Code your own.
-
Enter or paste your raw HTML code.
-
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 -
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. -
Click the Preview button to check the message design and personalization using test profiles. Learn more
-
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.
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 tonow().Example:
{%= getCurrentZonedDateTime() %}returns2024-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()ordiffInDays()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.
See Date and time functions for the full list of supported functions.