referencing javascript library in personalized block issue with delivery template | Community
Skip to main content
Level 4
November 9, 2019

referencing javascript library in personalized block issue with delivery template

  • November 9, 2019
  • 1 reply
  • 31223 views

HI

I am calling a javascript library into personalized block to do some URL parameter encryptions. That works fine when I preview the delivery template ( personalization) but when i try to use the delivery template to send out email fails with this error

JST -#ID# the result of the formula for the '<%LoadLibrary('URL in the '#ID#' delivery action is not valid . JST-#ID# failed to replace tracked URLs (content htmlContent)

this is the javascript on the personalized block

<%

  loadLibrary("wp:base64.js");

  var _email= recipient.email;

  var _id = recipient.id;

  var url = "id=" + _id + "&email=" + _email;

var main_url = "https://preferencestest.test.com";

%>

<%=main_url %>/Preferences/OptDown?params=<%=escapeUrl(Base64.encode(url))%>

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

1 reply

Jyoti_Yadav
Level 8
November 12, 2019

You could try something like this:

<%

var _email= recipient.email;

  var _id = recipient.id;

  var url = "id=" + _id + "&email=" + _email;

var buffer = new MemoryBuffer();

  buffer.fromString(url);

var encryptedString= buffer.toBase64();

%>

<%=main_url %>/Preferences/OptDown?params=<%=encryptedString%>

Thanks.

Level 4
November 12, 2019

I still get the same issue . it complains on Tracking URL

Level 4
November 14, 2019

Have you enabled it or disabled? Try disabling it and see. Then we can identify if that is an issue with tracking or without. The error is saying that it is failed to replace tracked urls. If this is not working even after disabling the tracking , probably raise a support ticket and we can guide you there.

Thanks!


yes I tried and is working. When I disable the tracking it works. I want to do the tracking though as we need to get the clicks tracked.