X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/442994d46d3c00fdc16a746d4020634b4bdda0d3..e6d19586dffa03e6fac4961c0a1b64b6a237d88d:/app/models/notifier.rb?ds=inline diff --git a/app/models/notifier.rb b/app/models/notifier.rb index 0539bdeb7..b53210c30 100644 --- a/app/models/notifier.rb +++ b/app/models/notifier.rb @@ -1,3 +1,5 @@ +require "base64" + class Notifier < ActionMailer::Base default :from => EMAIL_FROM, :return_path => EMAIL_RETURN_PATH, @@ -154,10 +156,13 @@ class Notifier < ActionMailer::Base def changeset_comment_notification(comment, recipient) with_recipient_locale recipient do + @root_url = root_url(:host => SERVER_URL) @changeset_url = changeset_url(comment.changeset, :host => SERVER_URL) @comment = comment.body @owner = recipient == comment.changeset.user @commenter = comment.author.display_name + @commenter_url = user_url(comment.author.display_name, :host => SERVER_URL) + @commenter_thumbnail_src = comment.author.image.url(:small, :host => SERVER_URL) @changeset_comment = comment.changeset.tags["comment"].presence @time = comment.created_at @changeset_author = comment.changeset.user.display_name @@ -168,6 +173,12 @@ class Notifier < ActionMailer::Base I18n.t("notifier.changeset_comment_notification.commented.subject_other", :commenter => @commenter) end + attachments.inline['osm_logo_30x30.png'] = { + mime_type: 'image/png', + encoding: 'base64', + content: @@osm_logo_png_bytes, + } + mail :to => recipient.email, :subject => subject end end @@ -191,4 +202,60 @@ class Notifier < ActionMailer::Base EMAIL_FROM end end + + # FIXME - 2016-12-28 - saintamh - someone please show me a better way to + # include this blob in here. If I save it under app/assets, how do I get a + # path to it in a portable way? + @@osm_logo_png_bytes = <