From 9f5787fd203fad5ffe1fb54525d65bf519457dc3 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 29 Apr 2013 19:26:03 +0100 Subject: [PATCH 1/1] Make the notification mails for notes show when a note is resolved --- app/models/notifier.rb | 5 +++-- .../notifier/note_comment_notification.html.erb | 4 ++-- config/locales/en.yml | 14 ++++++++++---- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/app/models/notifier.rb b/app/models/notifier.rb index 5972a700b..341c9072a 100644 --- a/app/models/notifier.rb +++ b/app/models/notifier.rb @@ -129,6 +129,7 @@ class Notifier < ActionMailer::Base @place = Nominatim.describe_location(comment.note.lat, comment.note.lon, 14, @locale) @comment = comment.body @owner = recipient == comment.note.author + @event = comment.event if comment.author @commenter = comment.author.display_name @@ -137,9 +138,9 @@ class Notifier < ActionMailer::Base end if @owner - subject = I18n.t('notifier.note_comment_notification.subject_own', :commenter => @commenter) + subject = I18n.t("notifier.note_comment_notification.#{@event}.subject_own", :commenter => @commenter) else - subject = I18n.t('notifier.note_comment_notification.subject_other', :commenter => @commenter) + subject = I18n.t("notifier.note_comment_notification.#{@event}.subject_other", :commenter => @commenter) end mail :to => recipient.email, :subject => subject diff --git a/app/views/notifier/note_comment_notification.html.erb b/app/views/notifier/note_comment_notification.html.erb index b17fe67f8..d82723bbb 100644 --- a/app/views/notifier/note_comment_notification.html.erb +++ b/app/views/notifier/note_comment_notification.html.erb @@ -1,9 +1,9 @@

<%= t 'notifier.note_comment_notification.greeting' %>

<% if @owner %> -

<%= t 'notifier.note_comment_notification.your_note', :commenter => @commenter, :place => @place %>

+

<%= t "notifier.note_comment_notification.#{@event}.your_note", :commenter => @commenter, :place => @place %>

<% else %> -

<%= t 'notifier.note_comment_notification.commented_note', :commenter => @commenter, :place => @place %>

+

<%= t "notifier.note_comment_notification.#{@event}.commented_note", :commenter => @commenter, :place => @place %>

<% end %> == diff --git a/config/locales/en.yml b/config/locales/en.yml index 0114751b6..67ef5d09b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1209,11 +1209,17 @@ en: click_the_link: "If this is you, please click the link below to reset your password." note_comment_notification: anonymous: An anonymous user - subject_own: "[OpenStreetMap] %{commenter} has commented on one of your notes" - subject_other: "[OpenStreetMap] %{commenter} has commented on a note you are interested in" greeting: "Hi," - your_note: "%{commenter} has left a comment on one of your map notes near %{place}." - commented_note: "%{commenter} has left a comment on a map note you have commented on. The note is near %{place}." + commented: + subject_own: "[OpenStreetMap] %{commenter} has commented on one of your notes" + subject_other: "[OpenStreetMap] %{commenter} has commented on a note you are interested in" + your_note: "%{commenter} has left a comment on one of your map notes near %{place}." + commented_note: "%{commenter} has left a comment on a map note you have commented on. The note is near %{place}." + closed: + subject_own: "[OpenStreetMap] %{commenter} has resolved one of your notes" + subject_other: "[OpenStreetMap] %{commenter} has resolved a note you are interested in" + your_note: "%{commenter} has resolved one of your map notes near %{place}." + commented_note: "%{commenter} has resolved a map note you have commented on. The note is near %{place}." details: "More details about the note can be found at %{url}." message: inbox: -- 2.43.2