X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/e5152c3931c8f0766b2201053427b398e3b13bde..506c0b5f0db8aca79ef61fa45cad508b7167817a:/app/models/notifier.rb diff --git a/app/models/notifier.rb b/app/models/notifier.rb index 0ed7071ac..54eb9b418 100644 --- a/app/models/notifier.rb +++ b/app/models/notifier.rb @@ -167,6 +167,7 @@ class Notifier < ActionMailer::Base def changeset_comment_notification(comment, recipient) with_recipient_locale recipient do + @to_user = recipient.display_name @changeset_url = changeset_url(comment.changeset, :host => SERVER_URL) @comment = comment.body @owner = recipient == comment.changeset.user @@ -188,6 +189,17 @@ class Notifier < ActionMailer::Base end end + def new_issue_notification(issue_id, recipient) + with_recipient_locale recipient do + @url = url_for(:host => SERVER_URL, + :controller => "issues", + :action => "show", + :id => issue_id) + subject = I18n.t("notifier.new_issue_notification.subject") + mail :to => recipient.email, :subject => subject + end + end + private def set_shared_template_vars @@ -195,7 +207,7 @@ class Notifier < ActionMailer::Base end def attach_project_logo - attachments.inline["logo.png"] = File.read("#{Rails.root}/app/assets/images/osm_logo_30.png") + attachments.inline["logo.png"] = File.read(Rails.root.join("app", "assets", "images", "osm_logo_30.png")) end def attach_user_avatar(user) @@ -207,7 +219,7 @@ class Notifier < ActionMailer::Base if image && image.file? return image.path(:small) else - return "#{Rails.root}/app/assets/images/users/images/small.png" + return Rails.root.join("app", "assets", "images", "users", "images", "small.png") end end