From 872a0d5bd801c998d911f7da582a60d2f714a710 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 20 Jan 2018 01:32:21 +0100 Subject: [PATCH] Improve HTML e-mails based on Litmus tests (#6301) * Use PNG images in HTML e-mails * Make webpack use URLs with host so fonts load inside HTML e-mails Convert this back to a relative URL in the premailer CSS loader since local requests are quicker * Improve responsive design * Add missing PNG icon --- app/javascript/images/mailer/icon_cached.png | Bin 0 -> 754 bytes app/javascript/images/mailer/icon_done.png | Bin 0 -> 279 bytes app/javascript/images/mailer/icon_email.png | Bin 0 -> 520 bytes app/javascript/images/mailer/icon_grade.png | Bin 0 -> 541 bytes .../images/mailer/icon_lock_open.png | Bin 0 -> 550 bytes .../images/mailer/icon_person_add.png | Bin 0 -> 512 bytes app/javascript/images/mailer/icon_reply.png | Bin 0 -> 391 bytes app/javascript/images/mailer/logo_full.png | Bin 0 -> 3052 bytes .../images/mailer/logo_transparent.png | Bin 0 -> 627 bytes app/javascript/styles/mailer.scss | 34 +++++++++++++++++- app/views/layouts/mailer.html.haml | 9 ++--- .../notification_mailer/favourite.html.haml | 2 +- .../notification_mailer/follow.html.haml | 2 +- .../follow_request.html.haml | 2 +- .../notification_mailer/mention.html.haml | 2 +- .../notification_mailer/reblog.html.haml | 2 +- .../confirmation_instructions.html.haml | 2 +- app/views/user_mailer/email_changed.html.haml | 2 +- .../user_mailer/password_change.html.haml | 2 +- .../reconfirmation_instructions.html.haml | 2 +- .../reset_password_instructions.html.haml | 2 +- app/views/user_mailer/welcome.html.haml | 12 +++---- config/webpack/configuration.js | 2 +- lib/mastodon/premailer_webpack_strategy.rb | 3 ++ 24 files changed, 56 insertions(+), 24 deletions(-) create mode 100644 app/javascript/images/mailer/icon_cached.png create mode 100644 app/javascript/images/mailer/icon_done.png create mode 100644 app/javascript/images/mailer/icon_email.png create mode 100644 app/javascript/images/mailer/icon_grade.png create mode 100644 app/javascript/images/mailer/icon_lock_open.png create mode 100644 app/javascript/images/mailer/icon_person_add.png create mode 100644 app/javascript/images/mailer/icon_reply.png create mode 100644 app/javascript/images/mailer/logo_full.png create mode 100644 app/javascript/images/mailer/logo_transparent.png diff --git a/app/javascript/images/mailer/icon_cached.png b/app/javascript/images/mailer/icon_cached.png new file mode 100644 index 0000000000000000000000000000000000000000..e62c064c837a38e059c578c3702259d80f389385 GIT binary patch literal 754 zcmV}Bt(6Kk5o{C- z1q)jd(G-H#>BLG1Scr`X7J?v%AtG2=szHc}2tg1@{39YU9*cEBhS}Yjoz2dE-OhXW zyZ7uH?l5;CgVb^LlX_nrNLk;bF4{RwWvROn&{)Foo*Icg+d2%jPz30h`a8w+TFTy| z>T*{@S-qvc)G_^|o=l0k*tJmVCUvHX@sfHlCHB^;Bjtrs`_##d=JV=sf%sOH8)_nF zf){Fk!eg_|Pr8U2LM6M{1>i=mf1#>75pg!*wFcPQf>%u=z*L>J#faG0)ImLBvF>%H z06XtWN@ibz+YL^NDNAz?+EpU9>QD2k@@W za>JJ13lI@+>lm*z$oncHW;0jWK~>5wU^UcRb^&THuovh{EDfh@uc=2pkaB$~BBo1) zQhR`>z@eO>gTTu=o;SOL`(yx zfJTpxEcynFM#SgRp#UP{F>tkj#R_mbB3?tWmOi2u2!&3*Xg+()9VpkoqBG{PSddH$bW0Ny)ok{m~?DPTi6V zsDn_dms4_|usR}0(|22a!|otd>U=}Jo^@|GLaBaJM-utN>IaGcHP$lFKhvoWLM^I$ kQfe4bA6T91k7ud-FFp|C^Xe=vvH$=807*qoM6N<$f?mi~w*UYD literal 0 HcmV?d00001 diff --git a/app/javascript/images/mailer/icon_done.png b/app/javascript/images/mailer/icon_done.png new file mode 100644 index 0000000000000000000000000000000000000000..0d2ef0cb87e34633a142ceda4651308421315514 GIT binary patch literal 279 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzmSQK*5Dp-y;YjHK@;M7UB8wRq zgi1h|@m`vI1yE43#5JNMI6tkVJh3R1p}f3YFEcN@I61K(RWH9NefB#WDWIY$o-U3d z5v^}8Y~*S-5OI6>#%USHz9#SG=W6q=Tb1~?*|lu`{c_Tyr5;@Z`3v@@Py7A%nC0nB z{}dOnuhad=vgW{AR=JzAwtQ6i!2W>O{Ev@K*x^QQ17>IL8kT7_I!p^ctPXR>4C*VHtv1`8$tDHL# zu^thonrCO|LN+Kz>biO(+kdS7>S4(KsB>A~b@iQkm}!>k3?z2dRW&M2TYahS7qkcJ zTlHF2^O?F+(DrN~v8B#r+S}^JIrcAXAf52F+Rk#8)#WU1SDJ>15kkHA#sR@3@Z{ zIbmR|yHF2I1D~yi)N06pFTmaN7Hic@iUhC%JgMUUe_}&0km$Q{;;cX6$mnMV8Ut6? zz`qgp-6{pvN#6HL}phZhA&$H0000< KMNUMnLSTZd&)@O@ literal 0 HcmV?d00001 diff --git a/app/javascript/images/mailer/icon_grade.png b/app/javascript/images/mailer/icon_grade.png new file mode 100644 index 0000000000000000000000000000000000000000..895b57d0a479cd084589866a6d48d346b8a23a95 GIT binary patch literal 541 zcmV+&0^O$%V7+Tm&7(E`W;Z9ZPUhj3m}z4crtY1Y%L zJOK&doUgh7YO4V-9ui*ASh;>BiGhTqw4~PHY7g!+5q`@+r=+Z;o8X?6bZd-x4Qnt~ zU`o=uq#i5Sgf)4H0*Is&Npr@Shp$!81)N5VIIhls?r2nK2KIj-{18aH%`5+t*{Wdp zE>Qn{@@EJGtN?E@!`A@+vjj{7PaeT9z=C&h5yY?uz_5$A>nhH9a6eWOV8{c&smB#y z&;!7!=iAdsekI>YYAO@pUQ$b`67V8=2%0D2;7yMaBce!CI?S3m}s!f~SkBfuqa9XGrKShdGpMsF(U f?T7{OuRpJMtFr%gO(CSK00000NkvXXu0mjfD1+c9 literal 0 HcmV?d00001 diff --git a/app/javascript/images/mailer/icon_lock_open.png b/app/javascript/images/mailer/icon_lock_open.png new file mode 100644 index 0000000000000000000000000000000000000000..9f62eadc2fa86656f7279d67ba79aebdac9531e5 GIT binary patch literal 550 zcmV+>0@?kEP)JUr%(1;OZ`qp&}jt9Z`x`p%PKh zD1{f`cK$^oQBt6%aQzf!WiC6+u3cOBlFgo(IeWfu=FHBXl`4kic?cMjG$U!mbzMu^ zH?ymvgoTLvfF0nKuXqKvf!;F7&pwgfyUWLEDI(m=6C42J-q-|i=#6g`O+Mx=`vK6N z;?oWsdFdD}Qoy=5yYX-QYM$R(OzgHu4MXn!U}l#gCo?;j^yr$yk+F*faN|~BH^x79 z1xiClXaMMtG%cw=W6Umh9|UG4-AOtzvzO=yKo8JJIc)Oc1n5rV3Z-C0Qa#JGf54Qa z<+OoN3TmD`_e=6*Gfrj^@Ub#xw)Y!$AThrjUM)mbp>hGi*YGC*HAxGuxnX7(ew2SwU1yY zK7rPvkiyPdD-jec5g$No)I<}A5dxn@b|u8@&m_Cp9q5+cBu zq-{yF-q5|IGc$WjLO;rU6R7c*PhdT5^Ch6w!`!C@ET&~{z*C61&m-Wr)xaK52Ff8d zr5NTu(?L4ffbls=QTsO;{VTsrNqXotG2$T7&4)v6HE3dx0JoCrG3siP?t&(>QhU$U zUUr{(|E0SR%xuGZegTJ)_9Frum{~Kl!fUu#bbXfrPD9F1fJ{Wd{sVa58n6Rg0d?A! z(j~Bk>+$Oqs4oEr25G`X2)YNH07fN^ODcLp&yrrutddFqATMc6(z2ulNriyAS4r2B zE+n0s*?T{Joq`jFGn+mYvYCZ!r5-|5^03|8@DcF^i zb6m7Aa-L@F0Qm&XeF`oCQX}p$yh*`34b34#-1z}{sb_xetc)c90000x(${t6;t)+@QcPhWt^P)DJlK??Mzlyb;TCzopr0MCGt!2kdN literal 0 HcmV?d00001 diff --git a/app/javascript/images/mailer/logo_full.png b/app/javascript/images/mailer/logo_full.png new file mode 100644 index 0000000000000000000000000000000000000000..1c4f332872011decb9658a01e0d4d9e26500485d GIT binary patch literal 3052 zcmVr001Hg1^@s6fXG4T00004b3#c}2nYxW zdekOaiA6=f4-Ga)1)ztcbN z`z80i-+Moj5EE$goyq*(UCz1ZzI*Pu=bZZ@gkbQL_mU1aZ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ezIDIxc!vrlu_IJ9TaEkaiDxPtA|J?QOz|4Ntg}J)`g^s=N#u2`7;JsFEiRJAr)~ z)u^DUg0zb|oQ;y@pxbjN_8AbyqX{P-;^N}$nQI1V)Onux%ca_|U7t5GGtmb}O*p|2 z_u*3RgueflXn7VQv#8rwQ7UNRv5VG(;|U2fZPzSV5GmT&tG|d0RHE4+-7uD>HQ<0a upd|>KQ8uEo0-U9JlX`Ax2;rO1aQH8;Lk=x}AGSdN0000iUAlX2~JQjBrhH;nd#(m+y;hi(@J?C&{ z<^~d|1uzk94A>9sjaG|ctH4UMW#Bb156p)UHp!t*stax(3+iMpdP!~mhiD5;^&&t} zhk%d3@IPg24_|;|1u)e{^dT@#+2hl|{bcPPa4N2i19RElgTORuJuBytI*>-HL7i1+ z^YqjK^>Lq`f^3l5rya$c|hbV8Y-IPi* zVX2$Uuc=>q7_E+{Fyw?<1+D;RDSrV*DQ~wOz#7m1o&j~>N!uqM_zTpOWIbP1kDCAh N002ovPDHLkV1nMp2l4;_ literal 0 HcmV?d00001 diff --git a/app/javascript/styles/mailer.scss b/app/javascript/styles/mailer.scss index b3bcc9209..dbe070f9a 100644 --- a/app/javascript/styles/mailer.scss +++ b/app/javascript/styles/mailer.scss @@ -17,7 +17,7 @@ body { -ms-text-size-adjust: 100%; } -.email_body { +.email-body { td, div, a, @@ -235,6 +235,12 @@ h5 { color: lighten($ui-base-color, 34%); } +.input-cell { + h5 { + margin-top: 4px; + } +} + .input { td { background: darken($ui-base-color, 8%); @@ -512,3 +518,29 @@ ul { min-height: 1024px !important; } } + +@media (max-width: 697px) { + .email-container, + .col-1, + .col-2, + .col-3, + .col-4, + .col-5, + .col-6 { + width: 100% !important; + max-width: none !important; + } + + .email-start { + padding-top: 16px !important; + } + + .email-end { + padding-bottom: 16px !important; + } + + .padded { + padding-left: 0 !important; + padding-right: 0 !important; + } +} diff --git a/app/views/layouts/mailer.html.haml b/app/views/layouts/mailer.html.haml index e41b91069..6687546fb 100644 --- a/app/views/layouts/mailer.html.haml +++ b/app/views/layouts/mailer.html.haml @@ -24,7 +24,7 @@ %tr %td.column-cell = link_to root_url do - = image_tag full_pack_url('logo_full.svg'), alt: 'Mastodon', height: 34, class: 'logo' + = image_tag full_pack_url('logo_full.png'), alt: 'Mastodon', height: 34, class: 'logo' = yield @@ -41,15 +41,12 @@ %tr %td.blank-cell.footer .email-row - .col-4 + .col-6 %table.column{ cellspacing: 0, cellpadding: 0 } %tbody %td.column-cell %p= t 'about.hosted_on', domain: site_hostname %p= link_to t('application_mailer.notification_preferences'), settings_notifications_url - .col-2 - %table.column{ cellspacing: 0, cellpadding: 0 } - %tbody %td.column-cell.text-right = link_to root_url do - = image_tag full_pack_url('logo_transparent.svg'), alt: 'Mastodon', height: 24 + = image_tag full_pack_url('logo_transparent.png'), alt: 'Mastodon', height: 24 diff --git a/app/views/notification_mailer/favourite.html.haml b/app/views/notification_mailer/favourite.html.haml index f26b08b18..7d1b494d0 100644 --- a/app/views/notification_mailer/favourite.html.haml +++ b/app/views/notification_mailer/favourite.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag full_pack_url('icon_grade.svg'), alt:'' + = image_tag full_pack_url('icon_grade.png'), alt:'' %h1= t 'notification_mailer.favourite.title' %p.lead= t('notification_mailer.favourite.body', name: @account.acct) diff --git a/app/views/notification_mailer/follow.html.haml b/app/views/notification_mailer/follow.html.haml index 1290e2bc4..31a2b7445 100644 --- a/app/views/notification_mailer/follow.html.haml +++ b/app/views/notification_mailer/follow.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag full_pack_url('icon_person_add.svg'), alt: '' + = image_tag full_pack_url('icon_person_add.png'), alt: '' %h1= t 'notification_mailer.follow.title' %p.lead= t('notification_mailer.follow.body', name: @account.acct) diff --git a/app/views/notification_mailer/follow_request.html.haml b/app/views/notification_mailer/follow_request.html.haml index 41efeafaf..44f1911c4 100644 --- a/app/views/notification_mailer/follow_request.html.haml +++ b/app/views/notification_mailer/follow_request.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag full_pack_url('icon_person_add.svg'), alt: '' + = image_tag full_pack_url('icon_person_add.png'), alt: '' %h1= t 'notification_mailer.follow_request.title' %p.lead= t('notification_mailer.follow_request.body', name: @account.acct) diff --git a/app/views/notification_mailer/mention.html.haml b/app/views/notification_mailer/mention.html.haml index 619c580ce..479fed41c 100644 --- a/app/views/notification_mailer/mention.html.haml +++ b/app/views/notification_mailer/mention.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag full_pack_url('icon_reply.svg'), alt: '' + = image_tag full_pack_url('icon_reply.png'), alt: '' %h1= t 'notification_mailer.mention.title' %p.lead= t('notification_mailer.mention.body', name: @status.account.acct) diff --git a/app/views/notification_mailer/reblog.html.haml b/app/views/notification_mailer/reblog.html.haml index 61c6ee6be..85b202cf9 100644 --- a/app/views/notification_mailer/reblog.html.haml +++ b/app/views/notification_mailer/reblog.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag full_pack_url('icon_cached.svg'), alt: '' + = image_tag full_pack_url('icon_cached.png'), alt: '' %h1= t 'notification_mailer.reblog.title' %p.lead= t('notification_mailer.reblog.body', name: @account.acct) diff --git a/app/views/user_mailer/confirmation_instructions.html.haml b/app/views/user_mailer/confirmation_instructions.html.haml index 0f999bcbc..1f088a16f 100644 --- a/app/views/user_mailer/confirmation_instructions.html.haml +++ b/app/views/user_mailer/confirmation_instructions.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag full_pack_url('icon_email.svg'), alt: '' + = image_tag full_pack_url('icon_email.png'), alt: '' %h1= t 'devise.mailer.confirmation_instructions.title' diff --git a/app/views/user_mailer/email_changed.html.haml b/app/views/user_mailer/email_changed.html.haml index 45dc06650..7e82f23e4 100644 --- a/app/views/user_mailer/email_changed.html.haml +++ b/app/views/user_mailer/email_changed.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag full_pack_url('icon_email.svg'), alt: '' + = image_tag full_pack_url('icon_email.png'), alt: '' %h1= t 'devise.mailer.email_changed.title' %p.lead= t 'devise.mailer.email_changed.explanation' diff --git a/app/views/user_mailer/password_change.html.haml b/app/views/user_mailer/password_change.html.haml index 2e9377dff..26314a217 100644 --- a/app/views/user_mailer/password_change.html.haml +++ b/app/views/user_mailer/password_change.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag full_pack_url('icon_lock_open.svg'), alt: '' + = image_tag full_pack_url('icon_lock_open.png'), alt: '' %h1= t 'devise.mailer.password_change.title' %p.lead= t 'devise.mailer.password_change.explanation' diff --git a/app/views/user_mailer/reconfirmation_instructions.html.haml b/app/views/user_mailer/reconfirmation_instructions.html.haml index 3ae226093..e3be8e295 100644 --- a/app/views/user_mailer/reconfirmation_instructions.html.haml +++ b/app/views/user_mailer/reconfirmation_instructions.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag full_pack_url('icon_email.svg'), alt: '' + = image_tag full_pack_url('icon_email.png'), alt: '' %h1= t 'devise.mailer.reconfirmation_instructions.title' %p.lead= t 'devise.mailer.reconfirmation_instructions.explanation' diff --git a/app/views/user_mailer/reset_password_instructions.html.haml b/app/views/user_mailer/reset_password_instructions.html.haml index c0e6775d4..5d9ce6a75 100644 --- a/app/views/user_mailer/reset_password_instructions.html.haml +++ b/app/views/user_mailer/reset_password_instructions.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag full_pack_url('icon_lock_open.svg'), alt: '' + = image_tag full_pack_url('icon_lock_open.png'), alt: '' %h1= t 'devise.mailer.reset_password_instructions.title' %p.lead= t 'devise.mailer.reset_password_instructions.explanation' diff --git a/app/views/user_mailer/welcome.html.haml b/app/views/user_mailer/welcome.html.haml index 0823efa1a..d734da67d 100644 --- a/app/views/user_mailer/welcome.html.haml +++ b/app/views/user_mailer/welcome.html.haml @@ -17,7 +17,7 @@ %tbody %tr %td - = image_tag full_pack_url('icon_done.svg'), alt: '' + = image_tag full_pack_url('icon_done.png'), alt: '' %h1= t 'user_mailer.welcome.title', name: @resource.account.username %p.lead= t 'user_mailer.welcome.explanation' @@ -30,7 +30,7 @@ %table.content-section{ cellspacing: 0, cellpadding: 0 } %tbody %tr - %td.content-cell + %td.content-cell.content-start .email-row .col-3 %table.column{ cellspacing: 0, cellpadding: 0 } @@ -46,7 +46,7 @@ %table.column{ cellspacing: 0, cellpadding: 0 } %tbody %tr - %td.column-cell.content-start + %td.column-cell %p= t 'user_mailer.welcome.full_handle_hint', instance: @instance %table.email-table{ cellspacing: 0, cellpadding: 0 } @@ -69,7 +69,7 @@ %table.column{ cellspacing: 0, cellpadding: 0 } %tbody %tr - %td.column-cell + %td.column-cell.padded %table.button.button-small{ align: 'left', cellspacing: 0, cellpadding: 0 } %tbody %tr @@ -89,7 +89,7 @@ %table.column{ cellspacing: 0, cellpadding: 0 } %tbody %tr - %td.column-cell + %td.column-cell.padded %table.button.button-small{ align: 'left', cellspacing: 0, cellpadding: 0 } %tbody %tr @@ -109,7 +109,7 @@ %table.column{ cellspacing: 0, cellpadding: 0 } %tbody %tr - %td.column-cell + %td.column-cell.padded %table.button.button-small{ align: 'left', cellspacing: 0, cellpadding: 0 } %tbody %tr diff --git a/config/webpack/configuration.js b/config/webpack/configuration.js index 822329490..26747e76b 100644 --- a/config/webpack/configuration.js +++ b/config/webpack/configuration.js @@ -27,7 +27,7 @@ function formatPublicPath(host = '', path = '') { const output = { path: resolve('public', settings.public_output_path), - publicPath: formatPublicPath(env.ASSET_HOST, settings.public_output_path), + publicPath: formatPublicPath(env.ASSET_HOST || env.LOCAL_DOMAIN, settings.public_output_path), }; module.exports = { diff --git a/lib/mastodon/premailer_webpack_strategy.rb b/lib/mastodon/premailer_webpack_strategy.rb index 4ea3ce80c..84d83cc66 100644 --- a/lib/mastodon/premailer_webpack_strategy.rb +++ b/lib/mastodon/premailer_webpack_strategy.rb @@ -2,6 +2,9 @@ module PremailerWebpackStrategy def load(url) + public_path_host = ENV['ASSET_HOST'] || ENV['LOCAL_DOMAIN'] + url = url.gsub(/\A\/\/#{public_path_host}/, '') + if Webpacker.dev_server.running? url = File.join("#{Webpacker.dev_server.protocol}://#{Webpacker.dev_server.host_with_port}", url) HTTP.get(url).to_s