Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!
SOLVED

Encrypt URL parameters for Preference Center

Avatar

Level 5

Hi,

I am looking to encrypt URL parameters for the Unsubscribe link at all the delivery templates using 64bit encryption.

there is out of the box few function but the client is specifically looking for 64 bit encryption Utf 8.

I have created a javascript code file and I am having problem calling that into the template

example: if the url currently that takes you to preference center is www.google.com?email=xxx@gmail.com&country=usa need to get encrypted to render as

http://www.google.com?params=KLLK776WEWLXXZZLKLKLSDD

LET ME KNOW

THANKS

1 Accepted Solution

Avatar

Correct answer by
Level 5

I got this one working. below is the code on the personalized block if anyone interested

<%

  loadLibrary("wp:base64.js");

  var _email= recipient.email;

  var _id = recipient.id;

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

%>

<%@ value object="provider" xpath="@trackingURL" %>/webApp/tstPreferenceCenter?params=<%=escapeUrl(Base64.encode(url))%>

View solution in original post

11 Replies

Avatar

Level 6

Hi,

I am copy-pasting the code that was used earlier but you can make changes as per your requirements. it is available to code but I am iterating it here. We can use the encrypt and decrypt functions to take care of.

AES encrypt and decrypt · GitHub

shoot me if you need more info on how we can make use of these functions with HTTP clientrequests.

1. we need to encrypt the email id or any other field while sending out email and decrypt it once we get a response. the total process depends on how this flow is handled at your org.

Avatar

Level 5

thanks for the information. So my question is how I can call this library into Email delivery template to pass the parameters? I assume the code that you provided can be saved as javascript code under configuration and I can reference that to be used on delivery templates? i am having issue referencing and calling external scripts int templates or Personalized blocks.

Avatar

Level 6

we have used this in web applications. the user is redirected to adobe campaign web application where we keep the above script to handle encryption and decryption.

when sending out the link with id, we send encrypted ID in the link as you mentioned and when the user clicks on the link he is directed to the web application hosted inside adobe campaign where the script takes care of decryption and we can use xtk: session write method to update the schema about subscription or unsubscription.

hope it is clear.

Avatar

Level 5

what I am referring is that I am having issue referencing custom java script code into email template. below is a snapshot of the javascript code and the email template where I am trying to call it by referencing the below in template is not working.

loadLibrary("xx:base6.js ");

javascript_code_1.pngemail_link_encrypt.png

loadLibrary("xxx:base64.js ");

Avatar

Level 6

It seems you are using in RT templates, I don't think we can call external scripts in RT templates.

As Message center server is hosted by adobe and to make it work you need to have access to that server, else it won't work.

Avatar

Level 5

I just picked a Message center template as sample but I will apply this on campaign delivery templates.

Avatar

Level 5

I was able to get this working using personalized block on delivery template. I will test more but seems to be good with one parameter. I will try to see how to use with multiple parameters.

Avatar

Level 6

Good to know that it worked.I have used it with email id and worked for me, let me know if you were able to use for multiple parameters.

Avatar

Level 4

Hi.

You cannot import javascript code into an 09email template, unfortunately. Templates are JSSP pages and they have they live in their ecosystem.

You can use personalization blocks, that is correct. Alternatively, you can use a typology rule or initialization script of the delivery to add some javascript code.

Last, but not least, you can create a stored procedure in some DB (SQL Server for example) that will encrypt the data and then map it into some variable in recipient data scheme or just expose it as a SQL function.

Also, for an unsubscribe function, the nms:recipient schema has @cryptedId attribute, that is recipient id encrypted with AES with server secret. If unsubscribe mechanic feeds back to Adobe server, you can use it as a token for unsubscribe function. It is secure and does not require you of exposing any of PII data.

Avatar

Correct answer by
Level 5

I got this one working. below is the code on the personalized block if anyone interested

<%

  loadLibrary("wp:base64.js");

  var _email= recipient.email;

  var _id = recipient.id;

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

%>

<%@ value object="provider" xpath="@trackingURL" %>/webApp/tstPreferenceCenter?params=<%=escapeUrl(Base64.encode(url))%>

Avatar

Level 5

HI Dima

I thought I resolved this issue but is not working well. Looks to be working on the preview but when trying on delivery is not working. The system throws errors when trying to send the email. it complains with following error.

screen_error.PNG

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)