From 872a0d5bd801c998d911f7da582a60d2f714a710 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 20 Jan 2018 01:32:21 +0100 Subject: 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 --- lib/mastodon/premailer_webpack_strategy.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') 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 -- cgit