YodaSpow / EmailDevTools

EmailTools
https://codepen.io/spowart/details/abWzBwR
7 stars 1 forks source link

AC Partial checker and duplication of GDPR or YourPlan - AC personalisation blocks #32

Closed YodaSpow closed 5 years ago

YodaSpow commented 5 years ago

Partial checker and duplication of GDPR or YourPlan - AC Personalisation blocks.

1) Check for doubling up of Copy in personalisation with in-line HTML.

2) Load a new TR TD below the matched personalisation block of the externally included inner HTML from a hosted txt file or similar:

<!-- PricePromise Footer Inject --> 
&lt;%@ include view='dixCoreFooterCurrysPricePromise' %&gt; 

<!-- GDPR Footer Inject --> 
&lt;%@ include view='dixCoreFooterCurrys' %&gt;
YodaSpow commented 5 years ago

Might be possible to inject this using similar regex:

  $('img').not(cache).each(function(){
    /* Remove AC bespoke IMG variable: ?&lt;%= cC %&gt; */
    this.src = this.src.replace(/(\?&lt;%= cC %&gt;|\?%3C%=%20cC%20%%3E)/g, ""); 
  });

Inject innerHTML for those 2 above. https://regexr.com/4a2ra

PricePromise Footer Inject If you find a major UK retailer has the same product at a cheaper price, we'll match it &#45; even up to 7 days after the purchase. Does not apply to ink products or third party sellers. Visit our price promise page at <a href="https://www.currys.co.uk/gbuk/price-promise-1023-theme.html?<%@ include view='dixDIXtrackingCPCW1' %>~SER~OTH~t&c~<%@ include view='dixDIXtrackingCPCW2' %>" _label="t&c_HOM" style="font-family: Arial, Helvetica, sans-serif; font-size:11px; line-height: 13px; color:#333332; text-decoration:underline; -webkit-text-size-adjust: 90%;">currys.co.uk</a> for details, conditions and the full list of major retailers (source: Retail Week Top 50 retailers by sales).<br /><br />

YodaSpow commented 5 years ago

GDPR Footer Inject

To find out more, please see our <a href="https://www.currys.co.uk/gbuk/privacy-on-currys-321-commercial.html?<%@ include view='dixDIXtrackingCPCW1' %>~COM~OTH~TsCs~<%@ include view='dixDIXtrackingCPCW2' %>" _label="TsCs" style="text-decoration:underline; color:#333333;">Privacy&nbsp;Policy</a>.<br /><br />
DSG Retail Limited reserves the right to end this offer without prior notice. All offers and products subject to availability.<br /><br />
Offer correct at time of publication, &lt;%= formatDate(new Date(), "%2D/%2M/%4Y") %&gt;.<br /><br />
Please do not reply to this email. If you need to contact us you can do so at: <a class="ios" style="text-decoration:underline; color:#333333; font-size:11px;" href="mailto:customer.services@currys.co.uk">customer.services@currys.co.uk</a><br /><br />           
Currys is a trading name of DSG&nbsp;Retail&nbsp;Limited, 1&nbsp;Portal&nbsp;Way, London, W3&nbsp;6RS, registered in England No.&nbsp;504877, VAT&nbsp;No.&nbsp;226&nbsp;6599&nbsp;33.
YodaSpow commented 5 years ago

Another method maybe: https://www.competa.com/blog/create-partials-in-a-static-site-with-jquery/

YodaSpow commented 5 years ago

Working example here now: https://codepen.io/spowart/pen/aMEvWv?editors=1011

YodaSpow commented 5 years ago

On this version; put whole email in: https://codepen.io/spowart/pen/ywpMPa?editors=1011 Issue is to resolve the ESP script that sits only in <a> tags, Want to leave these along as its needed for visually proofing tracking for Adobe Campaign in Browser when you click

YodaSpow commented 5 years ago

Working now as: https://codepen.io/spowart/pen/GLNorg?editors=0011

YodaSpow commented 5 years ago

Interesting Article maybe to Pull the HTML in as JSON would be good using Fetch: https://css-tricks.com/using-fetch/ https://github.com/zellwk/zl-fetch https://developer.github.com/v3/repos/#list-user-repositories

Codepen example of this: https://codepen.io/zellwk/pen/QvLRbE

https://regexr.com/4a878

YodaSpow commented 5 years ago

Commented out - Not used