FIX: Again, try to get a flexible absolute logo_url

This commit is contained in:
Robin Ward 2013-06-05 18:23:43 -04:00
parent 8328aa97fd
commit 4d1e8356b8
3 changed files with 9 additions and 3 deletions

View File

@ -12,7 +12,7 @@ module ApplicationHelper
def discourse_csrf_tags
# anon can not have a CSRF token cause these are all pages
# that may be cached, causing a mismatch between session CSRF
# that may be cached, causing a mismatch between session CSRF
# and CSRF on page and horrible impossible to debug login issues
if current_user
csrf_meta_tags

View File

@ -7,7 +7,7 @@
<tr>
<td>
<a href="<%= Discourse.base_url %>">
<%= image_tag(SiteSetting.logo_url, style: "height: 50px; margin-bottom: 15px; ") %>
<img src="<%= logo_url %>" style="height: 50px; margin-bottom: 15px;"></a>
</td>
</tr>
<tr>

View File

@ -13,10 +13,16 @@ class EmailRenderer
def html
formatted_body = EmailStyles.new(PrettyText.cook(text, environment: 'email')).format
logo_url = SiteSetting.logo_url
if logo_url !~ /http(s)?\:\/\//
logo_url = "#{Discourse.base_url}#{logo_url}"
end
ActionView::Base.new(Rails.configuration.paths["app/views"]).render(
template: 'email/template',
format: :html,
locals: { html_body: formatted_body }
locals: { html_body: formatted_body,
logo_url: logo_url }
)
end