Date Functions in Adobe Journey Optimizer for query parameters | Community
Skip to main content
Level 2
September 10, 2024
Solved

Date Functions in Adobe Journey Optimizer for query parameters

  • September 10, 2024
  • 1 reply
  • 712 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Mohan_Dugganab

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"/>

1 reply

Mohan_Dugganab
Adobe Employee
Mohan_DugganabAdobe EmployeeAccepted solution
Adobe Employee
September 10, 2024

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"/>