Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

fix custom logo in mail

ulfertsaff06fe91a0e
diff --git a/app/helpers/mail_notification_helper.rb b/app/helpers/mail_notification_helper.rb
index 9e550b118bb..577356108e6 100644
--- a/app/helpers/mail_notification_helper.rb
+++ b/app/helpers/mail_notification_helper.rb
@@ -37,20 +37,20 @@ module MailNotificationHelper
if current_logo.present?
logo_file = current_logo.local_file
logo = File.read(logo_file)
- suffix = MIME::Types.type_for(logo_file.path).first.content_type
+ content_type = MIME::Types.type_for(logo_file.path).first.content_type
else
logo = File.read(Rails.root.join('app/assets/images/logo_openproject_narrow.svg'))
- suffix = "svg+xml"
+ content_type = "image/svg+xml"
end
- email_image_tag(logo, suffix, **options)
+ email_image_tag(logo, content_type, **options)
end
- def email_image_tag(image, suffix, **options)
+ def email_image_tag(image, content_type, **options)
image_string = image.to_s
base64_string = Base64.strict_encode64(image_string)
- image_tag "data:image/#{suffix};base64,#{base64_string}", **options
+ image_tag "data:#{content_type};base64,#{base64_string}", **options
end
def unique_reasons_of_notifications(notifications)