GithubHelp home page GithubHelp logo

yodaspow / emaildevtools Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 1.0 353 KB

EmailTools

Home Page: https://codepen.io/spowart/details/abWzBwR

CSS 2.32% JavaScript 6.25% HTML 91.44%
email html-email qa email-design email-development design-tools gui scripts javascript jquery css html emails css3 email-qa email-dev

emaildevtools's Introduction

EmailTools

A cross-browser development tool for HTML email

Info

EmailTools allows you to see Image Alt styling, empty links and have a fast overview of an HTML email WITHOUT touching the source code for the HTML.

Note: _Javascript NEEDs to come out of HTML for send-time through your Email Service Provider (ESP).

bamboo-screenshot

Goal of EmailTools

Aim to have a dynamic interface that does not touch the HTML in email that can assist design/development time. To also QA (Quality Assure) critical elements of HTML email code before deployment.

Download

Download the latest release here.

Bookmarklet usage:

Bookmarklet on codepen: here.

Development

After forking/cloning put this code at bottom of your HTML body:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="css/core.css" rel="stylesheet" type="text/css" />
<script src="scripts/core.js"></script>

Integrated into HTML for sendtime automatic removal

You can put a data-driven IF statement from your ESP, a user-defined variable. Or using a primary key field in your send-data which is never empty:

<script><% var preSendScript = ""; if ( preSendScript == "REMOVED-ON-LIVE-SEND") { %></script>
<!--
Email Tools: Adobe Campaign: Auto-removes on send with user-defined variable | https://github.com/YodaSpow/EmailDevTools
-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://currys-ssl.cdn.dixons.com/css/themes/email/Assets/emailTool/core.js"></script>
<link href="https://currys-ssl.cdn.dixons.com/css/themes/email/Assets/emailTool/core.css" rel="stylesheet" type="text/css" />
<script><% } %></script>

emaildevtools's People

Contributors

dixonscarphonecrm avatar yodaspow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dixcar

emaildevtools's Issues

Grammerly integration

Is your feature request related to a problem? Please describe.
Spelling mistakes and grammar

Describe the solution you'd like
Page to be Grammarly checked when Grammer tab is checked

Toggle Adobe Campaign scripts OFF in browser: inside innerHTML

Toggle Adobe Campaign scripts OFF in browser: inside innerHTML
Have the ability to toggle OFF Adobe Campaign personalization code script that sits in the browser for local testing of rendering

var commentEJS = /(&lt;%).*(%&gt;)/g;
document.body.innerHTML = document.body.innerHTML.replace(commentEJS, "<!-- $&-->");

Movable ink 2nd ? check

Example how it should look link:

<a href="http://www.movable-ink-5819.com/p/cp/96954946b20ce364/c?mi_u=<%= iDMobileRecipients.id %>&url=http%3A%2F%2Fwww.movable-ink-5819.com%2Fp%2Frp%2Fbe4a755dfc94ae94%2Furl&<%@ include view='dixIDMtracking2018' %>1BNR1" _label="1BNR1">

Cant be:
1.

Furl&?
Furl<%@
  1. http://www.movable-ink-5819.com | Tracking exists on end: Needs & between
Furl<%@

F pattern overlay

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

What is the F-Pattern and how it works?
The F-Pattern describes the most common user eye-scanning patterns when it comes to blocks of content. F for fast. That’s how users read your content. In a few seconds, their eyes move at amazing speeds across your website�s page.

Why should I use it?
F-shaped pattern will help you create a design with good visual hierarchy, a design that people can scan easily. F-shaped layout feels comfortable for the most western readers, because they have been reading top to bottom, left to right for their entire lives.

When should I use it?
The F-pattern is the go-to layout for text-heavy websites like blogs and news sites. If there is a lot of content — especially text — users will respond better with the layout that designed according to the natural scanning format.

Additional context
https://www.nngroup.com/articles/f-shaped-pattern-reading-web-content/
https://uxplanet.org/f-shaped-pattern-for-reading-content-80af79cd3394

Remove ESP `?&lt;%= cC %&gt;` Clear cache EJS query BEFORE clear-cache for browser images (jquery method)

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 ?&lt;%= cC %&gt; before running the page loaded script for browser-based clear-caching

Describe alternatives you've considered
Maybe it could just be regex as find and remove: ?&lt;%= cC %&gt;

Additional context
Code base can then work with the intended result as the redundant EJS variable ?&lt;%= cC %&gt; is blocking the query function for clearing locally using EmailTools.

Page Reload with clear cache query for Email OFF

Page Reload with clear cache query for Email OFF:

Maybe possible to reload page using the clear cache query as a concatenation:

Maybe even after load do the force refresh (Not really needed but optional)

Clear Cache
javascript:location.href=location + '?clearCache=y';

Force Refresh
javascript:(function()%7Bvar gcs=function(e,s)%7Bif(typeof e.currentStyle!='undefined')%7Breturn e.currentStyle%5Bs%5D;%7Delse%7Breturn document.defaultView.getComputedStyle(e,null)%5Bs%5D;%7D%7D;var i,j,k,l,x,y,z,bi;z=%5B%5D;z.push(self);z.concat(self.frames);y=new Date().getTime();for(k=0,l=z.length;k<l;k++)%7Bx=z%5Bk%5D.document.getElementsByTagName('*');for(i=0,j=x.length;i<j;i++)%7Bbi=gcs(x%5Bi%5D,'backgroundImage');if(bi.indexOf(')')>-1)%7Bbi=bi.replace(/'/gi,'').replace(/"/gi,'');x%5Bi%5D.style.backgroundImage=bi.replace(')',(bi.indexOf('?')==-1?'?':'')+y+')');%7D%7D;x=z%5Bk%5D.document.getElementsByTagName('link');for(i=0,j=x.length;i<j;i++)%7Bx%5Bi%5D.href+=(x%5Bi%5D.href.indexOf('?')==-1?'?':'')+y;%7D;x=z%5Bk%5D.document.getElementsByTagName('img');for(i=0,j=x.length;i<j;i++)%7Bx%5Bi%5D.src+=(x%5Bi%5D.src.indexOf('?')==-1?'?':'')+y;%7D;%7D;%7D)();

Ref: https://meyerweb.com/eric/tools/dencoder/

Check existence of invalid 2nd query in tracking: 2x ?

Check existence of invalid 2nd query in tracking: 2x ?

  • There should be 1x ? after .html to the tracking
  • 2nd tracking needs to be & as there are delimited parts of most tracking already using the & checking for this could be tricky as that would require some kind of pattern check regex.

Solution:

  • Thinking this could be done with attribute CSS/Jquery selector
  • Simple regex for 1st ? existence only no 2nd ?

Images: Check image sizes, show which ones are too big

Is your feature request related to a problem? Please describe.
Would like to check if images are too big, not the width or height but the actual KB/MB.

Describe the solution you'd like
Thinking any image which over 300KB would get flagged with a pop up.

Describe alternatives you've considered
Lists all images in an email that is too large, preferably there would be a tooltip showing

Example from Litmus Rendercheck
Sizes

Alt triggered on actual OK text in alt tag

Bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Word with alt ie: Healthy

Expected behavior
Should not show error for invalid

Screenshots
glitch

Emulate dark mode iOS with EmailTools - "Lights off"

Create a new menu item for "Lights off" or "Darkmode"
Use pre-existing media query that gets adapted to be inherited for forced emulated dark mode

Describe the solution you'd like
Apple iOS Mail
Apple iOS Outlook

Maybe Samsung Dark mode will have to research which Apps support this

Steps it should do:

  1. Reset the email to a dark mode to emulate the above email clients
  2. Once its reset, apply the below CSS to the relevant sections

CSS in the email:
Existing CSS in the email that needs to be DOM manipulated to allow a dark mode on off status:

<!-- iOS Mail + iOs Outlook -->
<style type="text/css">  
@media (prefers-color-scheme: dark) , (prefers-dark-interface) { 
/* Cyber Monday Hijack, because top image was not PNG  
	html, body, th, td { background: #3d3d3d!important;}
*/  
	html, body, th, td { background: #2d2d2d!important;}
	html, body, th, td, span, a { color: #dfdfdf!important; -webkit-text-fill-color: #dfdfdf!important;}
	.logoW { width: 230px!important; }
	.logoIcon {	width: 200px!important; }  
  .logoIcon, .logoW { height: auto!important; padding: 10px 0px 10px 0px!important; }
	.dmHide { display:none!important; }
  .dmCTA { background-color:#000001!important; color:#feffff!important; }
  .dmNoShad { box-shadow: none!important; }
  
  /* Cyber Monday */
  .dmHRL { border-bottom: 2px solid #dfdfdf!important; }
  
  @media only screen and (min-width: 0px) and (max-width: 649px) { 
	.logoW { width: 94%!important; } 
	.logoIcon {	width: 100%!important; }   
  }
  
}  
</style>  

Menu item toggle for "Lights off" or "Darkmode" (default off)
This could be done with a toggle class similar to the rest of the "email tools" methods:
Class applied to body: <body class="darkMode"> would be toggle ON
html, body, th, td { background: #2d2d2d!important;}
becomes:
.darkMode .darkMode th, darkMode td { background: #2d2d2d!important;}

HTML in the email:
Header swaps for dark mode friendly images:

Logos:
Screen Shot 2019-11-15 at 20 37 49
Screen Shot 2019-11-15 at 20 54 10

<a href="#HDRlink##" _label="HDR">
<img src="https://currys-ssl.cdn.dixons.com/css/themes/email/Assets/CORE/CPCW_logo_3x.png" alt="Currys PC World" width="230" height="47" class="dw3 heightAuto dmHide" style="display:block; margin:0 auto; font-family:gBlack, Arial Black, Helvetica, sans-serif; color:#6A2C6B;" border="0" />

<img src="https://currys-ssl.cdn.dixons.com/css/themes/email/iD/2019-2020/wk29/BlackTag_WhyWait/v1/CPCW_logo_dm2_3x.png" alt="Currys PC World" width="1" height="1" class="dw3- heightAuto- logoW" style="display:block; margin:0 auto; font-family:gBlack, Arial Black, Helvetica, sans-serif; color:#6A2C6B;" border="0" />
</a>

Slant removals:
Screen Shot 2019-11-15 at 20 38 56

<!-- Slant PNG -->
<tr class="dmHide">
<td align="center" valign="top" class="fw"><img class="dw" align="left" width="650" src="https://currys-ssl.cdn.dixons.com/css/themes/email/iD/2019-2020/wk29/BlackTag_WhyWait/v1/slant2.png" alt=" " style="width:100%; max-width:100%; display:block; border:0px;" border="0" /></td>
</tr> 

CTA glitches, for iOS Outlook Apps ONLY
Need for having a bespoke class on some CTAs when using a light background with black text:
iOS Outlook App on iPhone needs to be babysat as it ignores the <a> call in CSS as:
Used this in iDM email: **
The layout was already dark mode friendly so didn't need to do the above code fixes

<!-- Outlook (Webmail-darkmode, iOS-darkmode) -->  
<style type="text/css">  
[data-ogsc] .footer a, 
[data-ogsc] .darkM { color: #feffff!important; } 
</style>  

You have to put babysit class on CTAs <a class="darkM"> directly or this happens:
Screen Shot 2019-11-15 at 21 01 31

Maybe there is a better solution to ensure the CSS is picked up. Plan for testing more options.

Latest Currys Skeleton with Darkmode:
Footer-with-darkmode.zip

Further reading:
https://nshipster.com/dark-mode/

More Glitches to review:
iOS_Outlook_App_DarkMode-ComeBack-1 (1)
iOS_Outlook_App_DarkMode-bharti-2
iOS_Outlook_App_DarkMode-4
iOS_Outlook_App_DarkMode-Gaming-2

Reference: Samsung Outlook App DarkMode
Samsung_Outlook_App_DarkMode
Reference: Samsung Outlook App Light
Samsung_Outlook_App_LightMode
Mode

fileiD
fileSlant issue

&nbsp; in Alt <IMG> not pull through on invalid character alt check

Bug
  in Alt not pull through on invalid character alt check

Link
https://litmus.com/checklist/tests/12693206/download.html
https://litmus.com/checklist/tests/12693195/download.html

Line: 543
bug

                            <tr>
                              <td valign="top" align="left"><a href="https://www.currys.co.uk/gbuk/search-keywords/xx_xx_xx_xx_xx/-1_in_20-/1_30/relevance-desc/xx-criteria.html?<%@ include view='dixDIXtrackingCPCW1' %>~SEG~FLO~2NOM2~<%@ include view='dixDIXtrackingCPCW2' %>" _label="2NOM2_FLO"><img align="left" width="308" height="196" src="https://currys-ssl.cdn.dixons.com/css/themes/email/2018-2019/wk43/PaydayDeals/SpringBNR07.jpg" alt=" Get your vacuum cleaner for&nbsp;free" border="0" class="dw" style="display:block; border:1px solid #1d428a;" /></a></td>
                            </tr>

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

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;

Update Fall-back font improvement.

Is your feature request related to a problem? Please describe.
Fall back for Arial vs Arial black based on a different in-line font calls in the email.

Applies for the ON/OFF switch for "Fonts"
font-family:gothamBlack, Arial black, Helvetica, sans-serif;: Fallback: Arial black
font-family:gothamBook, Arial, Helvetica, sans-serif;: Fallback: Arial

Radio buttons interface

Describe the solution you'd like
Use Radio buttons to show a full view of Tools without need use dropdown

Check HTML has Movable ink tracking pixel in the HTML

Is your feature request related to a problem? Please describe.
Check HTML has MI tracking pixel in the HTML based on if MI or not or relevant etc

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Device Fold emulator (320px | 414px )

Describe the solution you'd like
Buttons for 320px and 414px screen size Optionally you can add for each media-query device height (by the margin and bottom-border) to simulate 'fold' area.

Find un-used CSS

Can this be added to Email tools:?
https://davidwalsh.name/uncss

Other methods:
http://www.brothercake.com/dustmeselectors/
https://github.com/reworkcss/css
https://github.com/uncss/grunt-uncss

Chrome: Dev Tools Audit Tab
If you’re in the browser, you can use Google Chrome for this. Open the Web Dev tools, Click on the Audits tab, click Run, and then look through the “Remove unused CSS rules” list.

Only for a single page though.
chrome-audit-tool-2
https://techglimpse.com/chrome-developer-tools-improve-site-speed/

Correct invalid a href URL if present

Describe the solution you'd like
Check URL link paths are not already hexed from ESP eg:
http://t.e.currys.co.uk should be: https://www.currys.co.uk

Describe alternatives you've considered
Check to see id a href has www depends on what most ESP do for this if wanting to make it a generic check

Additional context
Cant use hexed URL from ESP pre-deployment, need to avoid.

What it does
The historical links and tracking is hexed on this domain from the ESP as a hidden link:

  1. By not removing it you will use the old link and tracking once it redirects.

fauxImg - Update width 100% as separate from global link.

Describe the bug

.yes a[href^="#"], .yes a[href*="##"], .pageType a[href*="PageType"], .category a[href*="Category"], .label a[_label*="_Category"], .altText .fauxImg, a[href*="#srcid"], a[href*="?intcmp"], a[href*="http://t.e.currys.co.uk"], .missingQuery, .notSecure, a[href*=" https"], a[href*=" ?"] {
  display: inline-block;
  /* width: 100%; */

Width 100% should only be on the fauxImg. Need to separate the class.
Capture

Test Issue added

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Email fold - Visual

Email Fold test:
https://actionrocket.cmail20.com/t/ViewEmail/j/1A2F363201FB56712540EF23F30FEDED/F074182C6690C06A40EE66FE10287772

Results: (More info )
http://www.emaildesignreview.com/action-rocket/results-from-our-emailweekly-test-4083/

The results have shown that around 410px would be our ‘email fold’, receiving 12% of clicks within the first 25% of the email. Although there did continue to be an even spread of clicks between 410px and 1600px, with 80% of recipients continuing to engage this far down the email.

Grad-text not visible on image off

Gradient Text not visible on image OFF for Alt text

If gradient text class gets used on Alt text
Email HTML:

<img class="fw h4 grad-T" align="left" width="650" src="-https://currys-ssl.cdn.dixons.com/css/themes/email/_Rolling ...

Email CSS:

@media screen and (-webkit-min-device-pixel-ratio: 0)
.grad-T {
  background: -webkit-linear-gradient(left, #082b69 0%, #691c5b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

Current EmailTools CSS: (core.css)
Image off toggle in Emailtools:

.altText img {
  background-image: url(https://currys-ssl.cdn.dixons.com/css/themes/email/Assets/emailTool/imgBG3.png)!important;
  min-height: 44px;
  min-width: 44px;
  box-shadow: inset 0 0 1px #b7b6b6, inset 0 0 15px rgba(255, 0, 255, 0.3);
}

The glitch:

Capture

The Fix - To be tested
Have a fix that seems to be working

.altText img {
  /*Remove: background-image: url(https://currys-ssl.cdn.dixons.com/css/themes/email/Assets/emailTool/imgBG3.png)!important; */
  min-height: 44px;
  min-width: 44px;
  box-shadow: inset 0 0 1px #b7b6b6, inset 0 0 15px rgba(255, 0, 255, 0.3);
  position: relative; /* ADD */
}

/* ADD */
.altText img:before {
  position: absolute;
  top: 0;
  left: 0;
  content: " ";
  background: url(https://currys-ssl.cdn.dixons.com/css/themes/email/Assets/emailTool/imgBG3.png);
  width: 100%;
  height: 100%;
}

Chrome:
Capture2

A ref ref remove tracking

?srcid=8324&cmpid=em~Currys~GiftingMON~FRI_PRO~wk29~undefined~20181127~UNK~COM~OTH~1BNR1~151187611&emid=105365520

Link Validate #srcid=11026 URL

Is your feature request related to a problem? Please describe.
Link Validate #srcid=11026 on end of a href URLs that can exist on link grabbing from website

a[href*="?intcmpid="],
a[href*=" https"],
a[href*=" ?"] {```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.