Expand my Community achievements bar.

SOLVED

Append to ALL the href urls of a delivery template the MD5 function of the recipient email

Avatar

Level 5

Hello everyone,

There is a native function to implement this request?

- Make the MD5 function of the current recipient email
- Append the previous one (as a suffix) to ALL the href of the <a> elements inside the delivery email.

If the answer is NO,

may someone help me with these functions above ?


Example:
email: salvdangelo@adobe.com
MD5(email): 3ec0e455a273149d24ce18c257908a08


<a href="google.it">Google</a>
<a href="twitter.com">Twitter</a>

After a click

href="google.it&email=3ec0e455a273149d24ce18c257908a08"
href="twitter.com&email=3ec0e455a273149d24ce18c257908a08"


For MD5 I may use "advanced selection" and select "Md5Digest()" with an additional data from incoming query but It doesn't seem the finest solution.

I cannot apply Md5Digest() inside the HTML of delivery activity but I am forced to used the additional data from the query.

Any solution?


Salvatore

Salvatore

Amit_Kumar

Vipul Raghav

florentlb

kirti.rawat

1 Accepted Solution

Avatar

Correct answer by
Level 10

1301326_pastedImage_0.png

Sorry I don't remember where it is described in the documentation, I let you find out in it.

Regards.
J-Serge

View solution in original post

8 Replies

Avatar

Level 5

UPDATE:

I included this personalization block:

<%

window.onload = function() {

var hashedEmail = targetData.hashedEmail;

var anchors = document.getElementsByTagName("a");

//Append hashed email to all the links inside the HTML

  for (var i = 0; i < anchors.length; i++) {

      anchors[i].href = anchors[i].href + "&email=" + hashedEmail;

  }

}

%>

but wndow, document, getElementsByTagName are not recognized (big problem)

Note: targetData.hashedEmail is the MD5(email) from the query activiy/box

Avatar

Level 10

Buon giorno Salvatore,

I used to use MD5 encoding as you do, in many Query or query-like activities, most of time by selecting extraction field email such as:

Md5Digest([recipient/@email]).

I find this very easy.
So I don't understand why this method doesn't fit your need in Delivery personalisation.

When it must be done in Javascript, you can use directly the JSAPI function: digestStrMd5(string), it works fine too.

Regarding the window DOM object, you are right, you can't use it in the AC Javascript, because the JS is used for personalisation on server side, not on client side.

One trick perhaps useful for your need, rather than doing by your own in html/JS code of the delivery body, why don't use the standard mechanism in Property/tracking & Images/ Advanced tab:
<%@ include option='NmsTracking_ClickFormula' %>&emailMD5=<%= Md5Digest(recipient.email) %>


It will be appended automatically for all your URL.

Regards.
J-Serge

Avatar

Level 5

Ok, thanks.

Could you explain which Property are you referring to ?
I supposed that one in "Recurring delivery" but maybe I'm wrong.

Please tell me step by step where should I put these string:

<%@ include option='NmsTracking_ClickFormula' %>&emailMD5=<%= Md5Digest(recipient.email) %>

Avatar

Correct answer by
Level 10

1301326_pastedImage_0.png

Sorry I don't remember where it is described in the documentation, I let you find out in it.

Regards.
J-Serge

Avatar

Level 5

Found it.
It's exactly what I was looking for.

You're the best mate. Thanks!

Salvatore

Avatar

Level 5

Hi Jean-Serge Biron,

I'm coming back to this task only to ask you if it's possible to append this tracking string NOT ONLY in the single delivery or template, but at platform/AC instance level.

It's something the customer would like to do.
Is it possible?

Salvatore

Avatar

Level 10

Buon giorno Salvatore,

I recommend to put the formulae in the default template model. So, whenever you create a new delivery or new delivery template, the formulae will be present.

But, in case of someone creates a delivery or delivery template by duplicating an existent one, older one where the formulae is not present, he could forget to add the formulae.

So to prevent this case, you can also add a typology rule to add in all the typologies of your platform, that checks the presence of the formulae in the current delivery during Proof submission and delivery submission. It can be warning but it can also be adding automatically the formulae if everything is the same for all deliveries.

Or, if the formulae is different from one delivery to another one, instead of typology rule and default delivery template, I rather suggest to modify the defaut factory form of new delivery wizard in order to add a form to ask user for the formulae.

Hoping I am enough clear on the possibilities.

Regards

J-Serge