Expand my Community achievements bar.

V7: Calling functions in control typology rule

Avatar

Level 2

We are creating the unsubscription link with at typology rule, where we would need to get a value into the unsubscription link which is based on some recipient field, but calculated in a function.

 

So we wrote a function that could for example make some hashing etc, but trying to call the function causes an error 'createKey is not defined', or 'recipient is not defined'.


Tried to run the typology rule in different phases like at the start of targeting, after targeting etc but no differece.
Is there some syntax error or is this possible in the first place?

function createKey(customerKey) {
  var hashedKey;
  //do something
  return hashedKey;
}

And how we tried to call: 

 

var headerUnsubUrl = "https://our.campaign.adobe.com/webApp/unsub1Click?id=<%= recipient.cryptedId %>&unsubkey=<%= (createKey(recipient.customerKey)) %>";

0 Replies