forgeplus/app/models/message_template/issue_deleted.rb

27 lines
934 B
Ruby
Raw Normal View History

2021-09-09 16:32:13 +08:00
# == Schema Information
#
# Table name: message_templates
#
2021-09-14 17:39:58 +08:00
# id :integer not null, primary key
# type :string(255)
# sys_notice :text(65535)
# email :text(65535)
# created_at :datetime not null
# updated_at :datetime not null
# notification_url :string(255)
2021-09-24 15:37:55 +08:00
# email_title :string(255)
2021-09-09 16:32:13 +08:00
#
# 我创建或负责的易修删除
class MessageTemplate::IssueDeleted < MessageTemplate
2021-09-14 23:04:33 +08:00
2021-09-15 18:55:58 +08:00
# MessageTemplate::IssueDeleted.get_message_content(User.where(login: 'yystopf'), User.last, "hahah")
def self.get_message_content(receivers, operator, issue_title)
2021-09-16 16:54:49 +08:00
content = sys_notice.gsub('{nickname}', operator&.real_name).gsub('{title}', issue_title)
2021-09-14 23:04:33 +08:00
return receivers_string(receivers), content, notification_url
rescue => e
Rails.logger.info("MessageTemplate::IssueAtme.get_message_content [ERROR] #{e}")
return '', '', ''
end
2021-09-09 16:32:13 +08:00
end