2023-11-02 11:07:35 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class TaskDueDateNotification < BaseNotification
|
|
|
|
def self.subtype
|
|
|
|
:my_module_due_date_reminder
|
|
|
|
end
|
|
|
|
|
2023-12-11 15:52:28 +08:00
|
|
|
def title
|
2023-12-11 20:18:08 +08:00
|
|
|
I18n.t(
|
|
|
|
'notifications.content.my_module_due_date_reminder.message_html',
|
|
|
|
my_module_name: subject.name
|
|
|
|
)
|
2023-12-11 15:52:28 +08:00
|
|
|
end
|
2023-11-02 11:07:35 +08:00
|
|
|
|
|
|
|
def subject
|
|
|
|
MyModule.find(params[:my_module_id])
|
|
|
|
end
|
2023-11-03 17:09:48 +08:00
|
|
|
|
|
|
|
after_deliver do
|
2023-12-13 20:30:23 +08:00
|
|
|
MyModule.find(params[:my_module_id]).update_column(:due_date_notification_sent, true)
|
2023-11-03 17:09:48 +08:00
|
|
|
end
|
2023-11-02 11:07:35 +08:00
|
|
|
end
|