diff --git a/app/helpers/user_notifications_helper.rb b/app/helpers/user_notifications_helper.rb index ad82c3c4f5ee8..10231369f1ef0 100644 --- a/app/helpers/user_notifications_helper.rb +++ b/app/helpers/user_notifications_helper.rb @@ -93,6 +93,10 @@ def digest_custom(i18n_key) PrettyText.format_for_email(I18n.t(i18n_key)).html_safe end + def show_image_with_url(url) + !(url.nil? || url.downcase.end_with?('svg')) + end + def email_image_url(basename) UrlHelper.absolute("#{Discourse.base_uri}/images/emails/#{basename}") end diff --git a/app/views/user_notifications/digest.html.erb b/app/views/user_notifications/digest.html.erb index 72dc79a86a2c1..d8819a9da7a8c 100644 --- a/app/views/user_notifications/digest.html.erb +++ b/app/views/user_notifications/digest.html.erb @@ -134,7 +134,7 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo
<%= t.user.name -%>
<% end %> - <%- if t.image_url.present? -%> + <%- if show_image_with_url(t.image_url) -%>