mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: don't try to show svg's in summary email
This commit is contained in:
@@ -93,6 +93,10 @@ module UserNotificationsHelper
|
|||||||
PrettyText.format_for_email(I18n.t(i18n_key)).html_safe
|
PrettyText.format_for_email(I18n.t(i18n_key)).html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def show_image_with_url(url)
|
||||||
|
!(url.nil? || url.downcase.end_with?('svg'))
|
||||||
|
end
|
||||||
|
|
||||||
def email_image_url(basename)
|
def email_image_url(basename)
|
||||||
UrlHelper.absolute("#{Discourse.base_uri}/images/emails/#{basename}")
|
UrlHelper.absolute("#{Discourse.base_uri}/images/emails/#{basename}")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo
|
|||||||
<p style="color:#8f8f8f;line-height:1.3;margin:0 0 16px 0;padding:0;"><%= t.user.name -%></p>
|
<p style="color:#8f8f8f;line-height:1.3;margin:0 0 16px 0;padding:0;"><%= t.user.name -%></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<%- if t.image_url.present? -%>
|
<%- if show_image_with_url(t.image_url) -%>
|
||||||
<td style="margin:0;padding:0 16px 8px 8px;text-align:right;" align="right">
|
<td style="margin:0;padding:0 16px 8px 8px;text-align:right;" align="right">
|
||||||
<img src="<%= url_for_email(t.image_url) -%>" height="64" style="margin:auto;max-height:64px;max-width:100%;outline:0;text-align:right;text-decoration:none;">
|
<img src="<%= url_for_email(t.image_url) -%>" height="64" style="margin:auto;max-height:64px;max-width:100%;outline:0;text-align:right;text-decoration:none;">
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user