mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
fixed 创建仓库开通建木DevOps
This commit is contained in:
28
app/models/message_template/project_open_dev_ops.rb
Normal file
28
app/models/message_template/project_open_dev_ops.rb
Normal file
@@ -0,0 +1,28 @@
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: message_templates
|
||||
#
|
||||
# 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)
|
||||
# email_title :string(255)
|
||||
#
|
||||
|
||||
# 我管理的仓库项目设置被更改
|
||||
class MessageTemplate::ProjectOpenDevOps < MessageTemplate
|
||||
|
||||
# MessageTemplate::ProjectOpenDevOps.get_message_content(User.where(login: 'yystopf'))
|
||||
def self.get_message_content(receivers, user, project)
|
||||
return '', '', '' if receivers.blank?
|
||||
content = sys_notice.gsub('{repository}', project&.name)
|
||||
url = notification_url.gsub('{owner}', project&.owner&.login).gsub('{identifier}', project&.identifier)
|
||||
return receivers_string(receivers), content, url
|
||||
rescue => e
|
||||
Rails.logger.info("MessageTemplate::ProjectOpenDevOps.get_message_content [ERROR] #{e}")
|
||||
return '', '', ''
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user