From 49a99ee2433490b9203a94b6e82e214a1678c3a8 Mon Sep 17 00:00:00 2001 From: Giga Chubinidze Date: Mon, 11 Dec 2023 16:18:08 +0400 Subject: [PATCH] updated notification title function --- app/notifications/low_stock_notification.rb | 6 +++++- app/notifications/repository_item_date_notification.rb | 8 +++++++- app/notifications/task_due_date_notification.rb | 5 ++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/app/notifications/low_stock_notification.rb b/app/notifications/low_stock_notification.rb index 31956e65a..093de6e7c 100644 --- a/app/notifications/low_stock_notification.rb +++ b/app/notifications/low_stock_notification.rb @@ -14,7 +14,11 @@ class LowStockNotification < BaseNotification end def title - I18n.t('notifications.content.item_low_stock_reminder.title_html') + I18n.t( + 'notifications.content.item_low_stock_reminder.message_html', + repository_row_name: subject.name, + repository: repository.name + ) end def subject diff --git a/app/notifications/repository_item_date_notification.rb b/app/notifications/repository_item_date_notification.rb index 8e0993a91..bb96f999b 100644 --- a/app/notifications/repository_item_date_notification.rb +++ b/app/notifications/repository_item_date_notification.rb @@ -16,7 +16,13 @@ class RepositoryItemDateNotification < BaseNotification end def title - I18n.t('notifications.content.item_date_reminder.title_html') + unit = human_readable_unit(column.metadata['reminder_unit'], column.metadata['reminder_value']) + I18n.t( + 'notifications.content.item_date_reminder.message_html', + repository_row_name: subject.name, + value: column.metadata['reminder_value'], + units: unit + ) end def subject diff --git a/app/notifications/task_due_date_notification.rb b/app/notifications/task_due_date_notification.rb index 39143195f..9fc1cf979 100644 --- a/app/notifications/task_due_date_notification.rb +++ b/app/notifications/task_due_date_notification.rb @@ -13,7 +13,10 @@ class TaskDueDateNotification < BaseNotification end def title - I18n.t('notifications.content.my_module_due_date_reminder.title_html') + I18n.t( + 'notifications.content.my_module_due_date_reminder.message_html', + my_module_name: subject.name + ) end def subject