Expand my Community achievements bar.

Join us for the Adobe Journey Optimizer Community Q&A Coffee Break on 28th February at 8 am PT with Ariel Sultan, Daniel Wright, Josee Haeley and Rohit Basuri.
SOLVED

How to comment a helper function or javascript code in email templates in AJO

Avatar

Level 8

Hi,

 

I am trying to create an email template for sending out campaigns in AJO. I wrote some html code and tried to comment it using <!-- hello --> and it is working fine.

However when in the same html code i added a helper function <!-- {%= age(date) %} --> the comments are not working properly.

 

Does anyone have an idea on how we can add a comment around helper functions .Attaching screenshot for reference 

 

arpangarg_0-1706082628840.png

Thanks

 

 

1 Accepted Solution

Avatar

Correct answer by
Level 8

Hi @Manoj_Kumar_ 

 

I was able to achieve this , i checked the handlebar documentation.

arpangarg_0-1706289481419.png

Using {{!-- This comment may contain mustaches like }} --}} its possible.

View solution in original post

3 Replies

Avatar

Community Advisor

Hello @arpan-garg 

 

<!-- helper function --> is the correct. It is just that the syntax highlighting is not working in the UI.

 

The helper function is a  server-side code and will be available in the email but will not be visible to the email recipient because it is commented out by a client-side syntax/code.


     Manoj
     Find me on LinkedIn

Avatar

Correct answer by
Level 8

Hi @Manoj_Kumar_ 

 

I was able to achieve this , i checked the handlebar documentation.

arpangarg_0-1706289481419.png

Using {{!-- This comment may contain mustaches like }} --}} its possible.

Avatar

Employee

You can use it as follows

{{!-- {%= toHexString(158) %} --}}