mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-21 20:25:45 +08:00
add: template email message
This commit is contained in:
@@ -27,4 +27,17 @@ class MessageTemplate::ProjectIssue < MessageTemplate
|
||||
Rails.logger.info("MessageTemplate::ProjectIssue.get_message_content [ERROR] #{e}")
|
||||
return '', '', ''
|
||||
end
|
||||
|
||||
def self.get_email_message_content(managers, followers, operator, issue)
|
||||
project = issue&.project
|
||||
owner = project&.owner
|
||||
receivers = managers + followers
|
||||
content = email.gsub('{nickname1}', operator&.real_name).gsub('{nickname2}', owner&.real_name).gsub('{repository}', project&.name).gsub('{title}', issue&.subject)
|
||||
url = notification_url.gsub('{owner}', owner&.login).gsub('{identifier}', project&.identifier).gsub('{id}', issue&.id.to_s)
|
||||
|
||||
return receivers_email_string(receivers), content, url
|
||||
rescue => e
|
||||
Rails.logger.info("MessageTemplate::ProjectIssue.get_email_message_content [ERROR] #{e}")
|
||||
return '', '', ''
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user