Expand my Community achievements bar.

Dive in, experiment, and see how our AI Assistant Content Accelerator can transform your workflows with personalized, efficient content solutions through our newly designed playground experience.
SOLVED

Date Functions in Adobe Journey Optimizer for query parameters

Avatar

Level 2

I have the following requirement: An email communication containing a countdown is required. From this, the email communication should be sent to customers with the counter starting on the date the email communication is sent and ending, for example, in seven days.

Currently the countdown is running using a fixed value, i.e. regardless of the date of sending the e-mail communication. For this, I am using the following script:

 

<img src="https://i.countdownmail.com/3iru0d.gif?end_date_time=2024-09-10T16:47:17+00:00" border="0" alt="countdownmail.com" class="is-highlight" style="text-align: center;">

 

To use the email communication send date, I tried to use the Adobe Journey Optimizer functions in the script described above:

 

<img src={%= concat("https://i.countdownmail.com/3iru0d.gif?end_date_time=", setDays(now(), 7)) %} border="0" alt="countdownmail.com"/>

 

However, I got the following result:

 

Invalid syntax Error in parsing PQL expression "concat("https://i.countdownmail.com/3iru0d.gif?end_date_time=", setDays(now(), 7))": line 1:71 extraneous input '(' expecting {')', ','}. Error beginning at position: Line 1, Character 10

 

Thanks in advance

1 Accepted Solution

Avatar

Correct answer by
Employee

You can validate it on the following lines 

{% let d = toDateTimeOnly(currentTimeInMillis()+7*1000*60*60*24) %}
{% let x = formatDate(d, "yyyy-MM-ddTHH:MM:SSZ") %}
{% let y = concat("https://i.countdownmail.com/3iru0d.gif?end_date_time=",x) %}
<img src={{y}} border="0" alt="countdownmail.com"/>

View solution in original post

1 Reply

Avatar

Correct answer by
Employee

You can validate it on the following lines 

{% let d = toDateTimeOnly(currentTimeInMillis()+7*1000*60*60*24) %}
{% let x = formatDate(d, "yyyy-MM-ddTHH:MM:SSZ") %}
{% let y = concat("https://i.countdownmail.com/3iru0d.gif?end_date_time=",x) %}
<img src={{y}} border="0" alt="countdownmail.com"/>