mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-21 20:25:45 +08:00
add: email message sended by html
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# notification_url :string(255)
|
||||
# email_title :string(255)
|
||||
#
|
||||
|
||||
# 账号仓库权限变更
|
||||
@@ -25,9 +26,18 @@ class MessageTemplate::ProjectRole < MessageTemplate
|
||||
end
|
||||
|
||||
def self.get_email_message_content(receivers, project, role)
|
||||
content = email.gsub('{repository}', project&.name).gsub('{role}', role)
|
||||
url = notification_url.gsub('{owner}', project&.owner&.login).gsub('{identifier}', project&.identifier)
|
||||
return receivers_email_string(receivers), content, url
|
||||
title = email_title
|
||||
title.gsub!('{repository}', project&.name)
|
||||
title.gsub!('{role}', role)
|
||||
content = email
|
||||
content.gsub!('{receiver}', receiver&.real_name)
|
||||
content.gsub!('{baseurl}', base_url)
|
||||
content.gsub!('{login}', project&.owner&.login)
|
||||
content.gsub!('{identifier}', project&.identifier)
|
||||
content.gsub!('{repository}', project&.name)
|
||||
content.gsub!('{role}', role)
|
||||
|
||||
return receiver&.mail, title, content
|
||||
rescue => e
|
||||
Rails.logger.info("MessageTemplate::ProjectRole.get_email_message_content [ERROR] #{e}")
|
||||
return '', '', ''
|
||||
|
||||
Reference in New Issue
Block a user