Closed YodaSpow closed 5 years ago
Have some code here: https://codepen.io/spowart/pen/vPxdwM
var versionUpdate = (new Date()).getTime(); // Works in AC
/* Doesnt work in Adobe Campaign*/
var imgs = document.querySelectorAll('img'), len = imgs.length;
for (var i=0; i<len; i++) {
//imgs[i].style.background = "green";
var s = imgs[i].src;
imgs[i].src = s + "?" + versionUpdate;
console.log(imgs[i].src);
}
Maybe it's possible to do as regex instead: https://codepen.io/spowart/pen/XGeOYL?editors=1010
Got it working:
$('img').not(cache).each(function(){
/* Remove AC bespoke IMG variable: ?<%= cC %> */
this.src = this.src.replace(/(\?<%= cC %>|\?%3C%=%20cC%20%%3E)/g, "");
var versionUpdate = (new Date()).getTime();
this.src = this.src + '?' + versionUpdate;
});
Tested it here: regexr.com/4a22f
Updated as of this commit: f0068cf4538a9b83d2eabf60abfbf5a8d0f86681
Adobe Campaign: (AC pre-send to Inbox) LEFT: AC Pre-Send time ----------- RIGHT: Sent from AC to Litmus code view https://www.diffchecker.com/OywA6STg
EmailTool (Local HTML, source code vs computed JS) LEFT: Adobe Campaign ready code: cC variable ----- RIGHT: Browser running EmailTools as computed JS https://www.diffchecker.com/t9EYgWkC
Is your feature request related to a problem? Please describe. Clear cache for ESP (?<%= cC %>) is added ad-hoc after images src path.
Describe the solution you'd like Remove the
?<%= cC %>
before running the page loaded script for browser-based clear-cachingDescribe alternatives you've considered Maybe it could just be regex as find and remove:
?<%= cC %>
Additional context Code base can then work with the intended result as the redundant EJS variable
?<%= cC %>
is blocking the query function for clearing locally using EmailTools.