2023-10-19 17:33:40 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class LowStockNotification < BaseNotification
|
|
|
|
def message
|
|
|
|
I18n.t(
|
2023-11-21 21:21:55 +08:00
|
|
|
'notifications.content.item_low_stock_reminder.message_html',
|
2023-10-19 17:33:40 +08:00
|
|
|
repository_row_name: subject.name
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2023-11-24 21:58:46 +08:00
|
|
|
def self.subtype
|
2023-10-19 17:33:40 +08:00
|
|
|
:item_low_stock_reminder
|
|
|
|
end
|
|
|
|
|
2023-11-21 21:21:55 +08:00
|
|
|
def title
|
|
|
|
I18n.t('notifications.content.item_low_stock_reminder.title_html')
|
|
|
|
end
|
2023-10-19 17:33:40 +08:00
|
|
|
|
|
|
|
def subject
|
|
|
|
RepositoryRow.find(params[:repository_row_id])
|
|
|
|
end
|
|
|
|
end
|