We are trying to encrypt the ID of the recipient using DES before using it inside an anchor <a></a> tag. And getting the error as described below.
It seems that the method getOption is not available inside the delivery content javascript. We don't want hard coded value there
We thought about using the Delivery >> Properties >> Variables
But for that we have to set the variable in the activity connecting the delivery. Or there has to be some way to set the value of the variable inside the delivery activity after reading from the options. If there is such option, we are ok with that as well.
Also referred to the below document for implementation, but it is not working.
Here is the workflow created for test purpose
The script inside Delivery content:
<%
var baseURL = getOption("lbkUSAFindNohURL")
var key = getOption("lbkUSADESKey");
var cipherMode= getOption("lbkUSADESCipherMode")
var intiVector = getOption("lbkUSADESIV")
var padding = getOption("lbkUSADESPadding")
var encryptedVal = encryptDES(key,recipient.id,cipherMode,intiVector,padding)
var unSubURl = baseURL + "/unsubscribe?docId=" + escapeUrl(encryptedVal)
%>
And here is how the link inside the html looks:
<a href="<%= unSubURl %>" style="color: #7293C0">here</a>
03/10/2016 9:21:09 AM Failed Unreachable xxxx@yyy.com Error while compiling script 'content htmlContent' line 4: getOption is not defined. JavaScript: error while evaluating script 'content htmlContent'.
Tried to use variable:
Added these lines in the advanced tab of the Query activity:
vars.baseURL = getOption("lbkUSAFindNohURL")
vars.key = getOption("lbkUSADESKey");
vars.cipherMode= getOption("lbkUSADESCipherMode")
vars.intiVector = getOption("lbkUSADESIV")
vars.padding = getOption("lbkUSADESPadding")
And changed the delivery as below:
<%
var baseURL = vars.baseURL
var key = vars.key
var cipherMode= vars.cipherMode
var intiVector = vars.intiVector
var padding = vars.padding
var encryptedVal = encryptDES(key,recipient.id,cipherMode,intiVector,padding)
var unSubURl = baseURL + "/unsubscribe?docId=" + escapeUrl(encryptedVal)
%>
Getting this error now:
03/10/2016 9:29:34 AM Failed Unreachable xxxx@yyyy.com Error while compiling script 'content htmlContent' line 4: vars is not defined. JavaScript: error while evaluating script 'content htmlContent'.
Solved! Go to Solution.
Views
Replies
Total Likes
The syntax to access options is different for landing page and a delivery.
For Delivery:
<span> <%@ include option='NmsServer_IntranetURL' %></span>
For Landing page:
<span><%= getOption('NmsServer_IntranetURL') %></span>
The syntax to access options is different for landing page and a delivery.
For Delivery:
<span> <%@ include option='NmsServer_IntranetURL' %></span>
For Landing page:
<span><%= getOption('NmsServer_IntranetURL') %></span>
Views
Likes
Replies
Views
Likes
Replies