diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index 029c328bb..355f60550 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -7,15 +7,22 @@ module NotificationsHelper end def event_notification_body(event) - name = event.creator.name + creator = event.creator.name case event_notification_action(event) - when "card_closed" then "Moved to Done by #{name}" - when "card_reopened" then "Reopened by #{name}" - when "card_published" then "Added by #{name}" - when "comment_created" then comment_notification_body(event) when "card_assigned" then "Assigned to #{event.assignees.none? ? "self" : event.assignees.pluck(:name).to_sentence}" - else name + when "card_unassigned" then "Unassigned by #{creator}" + when "card_published" then "Added by #{creator}" + when "card_closed" then "Moved to Done by #{creator}" + when "card_reopened" then "Reopened by #{creator}" + when "card_postponed" then "Moved to Not Now by #{creator}" + when "card_auto_postponed" then "Moved to Not Now due to inactivity" + when "card_title_changed" then "Renamed by #{creator}" + when "card_board_changed" then "Moved by #{creator}" + when "card_triaged" then "Moved to #{event.particulars.dig("particulars", "column")} by #{creator}" + when "card_sent_back_to_triage" then "Moved back to Maybe? by #{creator}" + when "comment_created" then comment_notification_body(event) + else creator end end diff --git a/app/views/notifications/notification/event/_body.html.erb b/app/views/notifications/notification/event/_body.html.erb index 25235372f..79f9c7fa2 100644 --- a/app/views/notifications/notification/event/_body.html.erb +++ b/app/views/notifications/notification/event/_body.html.erb @@ -5,5 +5,5 @@
- <%= event_notification_body(event) %> + <%= event_notification_body(event) %>