Skip to content
Snippets Groups Projects
Unverified Commit 872a0d5b authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

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
parent 01421999
No related branches found
No related tags found
No related merge requests found
......@@ -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'
......
......@@ -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
......
......@@ -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 = {
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment