Skip to content

Instantly share code, notes, and snippets.

@fivedoor-gists
fivedoor-gists / email-remove_comments-regex
Created October 3, 2019 15:22
email-remove_comments-regex
(?s)<!--(?!<!)[^\[>].*?-->
Not including conditional comments
https://stackoverflow.com/questions/1084741/regexp-to-strip-html-comments/29194283
https://www.jamesfawcett.co.uk/removing-comments-code-sublime-text/
@fivedoor-gists
fivedoor-gists / email-shell-basic
Created October 3, 2019 15:02
html|email|template
<html>
======
xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"
Including a Vector Markup Language (VML) namespace declaration, to ensure email will render any VML
<head>
======
<head>Yahoo App Android will strip this</head>
https://github.com/hteumeuleu/email-bugs/issues/28
@fivedoor-gists
fivedoor-gists / email-gmail-promotions_tab
Created September 13, 2019 15:52
email-gmail-promotions_tab
http://freshinbox.com/tools/gmailpromotab/
https://stripo.email/gmail-promo
https://developers.google.com/gmail/promotab/troubleshooting
@fivedoor-gists
fivedoor-gists / email-button-stig
Created September 6, 2019 09:03
email-button-stig
<a href="http://test.com/"
style="background-color: #7fc549;
background-image: linear-gradient(to top, #56ab2f, #a8e063);
border: 1px solid #4e9a2a;
border-radius: 3px;
color: #ffffff;
display: inline-block;
font-family: sans-serif;
font-weight: bold;
mso-border-alt: 8px solid #7fc549;
@fivedoor-gists
fivedoor-gists / email-gmail_app-centering-fix
Last active October 3, 2019 16:20
email-gmail_app-centering-fix
!-- METHOD 1 -->
<style>
u + .body {
min-width:100vw;
border: 1px solid #ffffff;
}
</style>
<!-- Fixes IOS gmail but seems to break android gmail
However:
- ensuring media queries are in separate style block to main resets
@fivedoor-gists
fivedoor-gists / email-Outlook.com-365-underline-fix
Created September 1, 2019 18:45
email-Outlook.com-365-underline-fix
<!-- Use this in your style and it should work
https://litmus.com/community/discussions/174-removing-underline-from-outlook#comment-15008 -->
display: inline-block
@fivedoor-gists
fivedoor-gists / email-OL-line-height-fix
Last active October 3, 2019 16:19
email-OL-line-height-fix
<!-- Add to inline style in td -->
<!-- https://litmus.com/community/discussions/6757-line-height-issue-on-outlook-and-mso-line-height-rule-exactly-isnt-working -->
mso-line-height-rule: exactly; line-height: 150%; line-height: ###LINEHEIGHT####px;
<!-- Also try: -->
mso-line-height-alt: 150%; line-height: ###LINEHEIGHT####px;
@fivedoor-gists
fivedoor-gists / email-target-samsung
Created August 9, 2019 08:48
email-target-samsung
<style>
/* Samsung
=========== */
#MessageViewBody .foo { display: none !important;
}
/* if you have designs that utilize absolute positioning, you can hide those designs from the Samsung email client by using the following CSS.
Note this also means that the Samsung client replaces any id you set to the body tag in your email with its own.
https://www.emailonacid.com/blog/article/email-development/absolute-positioning-in-the-samsung-android-email-client
*/
@fivedoor-gists
fivedoor-gists / email-target-ios
Created August 9, 2019 08:48
email-target-ios
<style>
/* IOS 10 & IOS 11
=================== */
@supports (-webkit-overflow-scrolling:touch) and (color:#ffff) {
}
/* We can target iOS with the proprietary property “-webkit-overflow-scrolling” that is only supported on iOS. If we use this in combination with one of the properties supported exclusively in iOS’ most recent webkit versions— #RGBA color notations, for example—we can specifically target iOS 10 and above.
https://litmus.com/blog/what-email-marketers-need-to-know-about-ios-11-and-the-new-iphones
*/
/* iOS 11.0 & 11.1
@fivedoor-gists
fivedoor-gists / email-target-outlook.com
Last active October 3, 2019 16:19
email-target-outlook.com
<style>
/* OWA Outlook.com
================== */
[owa] .foo {
}
</style>
<!-- Outlook.com and Office365 don’t support attribute selectors in CSS.
Both webmail apps remove the attribute from the selector, changing its meaning and initial intention.