diff --git a/app/notifications/low_stock_notification.rb b/app/notifications/low_stock_notification.rb index e7d03d200..31956e65a 100644 --- a/app/notifications/low_stock_notification.rb +++ b/app/notifications/low_stock_notification.rb @@ -4,7 +4,8 @@ class LowStockNotification < BaseNotification def message I18n.t( 'notifications.content.item_low_stock_reminder.message_html', - repository_row_name: subject.name + repository_row_name: subject.name, + repository: repository.name ) end @@ -19,4 +20,8 @@ class LowStockNotification < BaseNotification def subject RepositoryRow.find(params[:repository_row_id]) end + + def repository + Repository.find(subject.repository_id) + end end diff --git a/app/notifications/task_due_date_notification.rb b/app/notifications/task_due_date_notification.rb index 215626f0a..18f8b84f2 100644 --- a/app/notifications/task_due_date_notification.rb +++ b/app/notifications/task_due_date_notification.rb @@ -3,7 +3,7 @@ class TaskDueDateNotification < BaseNotification def message I18n.t( - 'notifications.notification.my_module_due_date_reminder_html', + 'notifications.content.my_module_due_date_reminder.message_html', my_module_name: subject.name ) end diff --git a/config/initializers/scheduler.rb b/config/initializers/scheduler.rb index d545df7af..85a2f2c41 100644 --- a/config/initializers/scheduler.rb +++ b/config/initializers/scheduler.rb @@ -22,7 +22,9 @@ if ENV['ENABLE_FLUICS_SYNC'] == 'true' end end -scheduler.every '1h' do +reminder_job_interval = ENV['REMINDER_JOB_INTERVAL'] || '1h' + +scheduler.every reminder_job_interval do MyModules::DueDateReminderJob.perform_now RepositoryItemDateReminderJob.perform_now end diff --git a/config/locales/en.yml b/config/locales/en.yml index 00e82635c..9d377b06b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3444,13 +3444,13 @@ en: content: my_module_due_date_reminder: title_html: "Task due date reminder" - message_html: "Due date for %{my_module_name} is coming up" + message_html: "Due date for a task %{my_module_name} is coming up." item_low_stock_reminder: title_html: "Item stock reminder" - message_html: "Item %{repository_row_name} is running low" + message_html: "Item %{repository_row_name} in inventory %{repository} is running low." item_date_reminder: title_html: "Item date reminder" - message_html: "Date reminder for %{repository_row_name} is coming up in %{value} %{units}" + message_html: "Date reminder for %{repository_row_name} is coming up in %{value} %{units}." deliver: download_link: "Download link:" download_text: "Click the link to download the file."