From 7485564bb9280431831a77bb5aa2649c411614b9 Mon Sep 17 00:00:00 2001 From: yystopf Date: Tue, 15 Feb 2022 18:30:13 +0800 Subject: [PATCH] add: template message platform varible --- app/models/message_template.rb | 45 ++++++++++--------- app/models/message_template/issue_assigned.rb | 1 + app/models/message_template/issue_changed.rb | 1 + app/models/message_template/issue_deleted.rb | 1 + app/models/message_template/issue_expire.rb | 1 + .../message_template/organization_joined.rb | 1 + .../message_template/organization_left.rb | 1 + .../message_template/organization_role.rb | 1 + app/models/message_template/project_issue.rb | 1 + app/models/message_template/project_joined.rb | 1 + app/models/message_template/project_left.rb | 1 + .../message_template/project_member_joined.rb | 1 + .../message_template/project_member_left.rb | 1 + .../message_template/project_milestone.rb | 1 + .../project_milestone_completed.rb | 1 + .../message_template/project_pull_request.rb | 1 + app/models/message_template/project_role.rb | 1 + .../project_setting_changed.rb | 1 + .../message_template/pull_request_assigned.rb | 1 + .../message_template/pull_request_changed.rb | 1 + .../message_template/pull_request_closed.rb | 1 + .../message_template/pull_request_merged.rb | 1 + app/models/message_template/team_joined.rb | 1 + app/models/message_template/team_left.rb | 1 + public/message_template/issue_assigned.html | 2 +- public/message_template/issue_changed.html | 2 +- public/message_template/issue_deleted.html | 2 +- public/message_template/issue_expire.html | 2 +- .../message_template/organization_joined.html | 2 +- .../message_template/organization_left.html | 2 +- .../message_template/organization_role.html | 2 +- public/message_template/project_issue.html | 2 +- public/message_template/project_joined.html | 2 +- public/message_template/project_left.html | 2 +- .../project_member_joined.html | 2 +- .../message_template/project_member_left.html | 2 +- .../message_template/project_milestone.html | 2 +- .../project_milestone_completed.html | 2 +- .../project_pull_request.html | 2 +- public/message_template/project_role.html | 2 +- .../project_setting_changed.html | 2 +- .../pull_request_assigned.html | 2 +- .../pull_request_changed.html | 2 +- .../message_template/pull_request_closed.html | 2 +- .../message_template/pull_request_merged.html | 2 +- public/message_template/team_joined.html | 2 +- public/message_template/team_left.html | 2 +- 47 files changed, 69 insertions(+), 45 deletions(-) diff --git a/app/models/message_template.rb b/app/models/message_template.rb index bc1c8003..13864184 100644 --- a/app/models/message_template.rb +++ b/app/models/message_template.rb @@ -13,66 +13,67 @@ # class MessageTemplate < ApplicationRecord + PLATFORM = 'GitLink' def self.build_init_data MessageTemplate::IssueAssignerExpire.destroy_all MessageTemplate::IssueCreatorExpire.destroy_all self.create(type: 'MessageTemplate::FollowedTip', sys_notice: '{nickname} 关注了你', notification_url: '{baseurl}/{login}') email_html = File.read("#{email_template_html_dir}/issue_assigned.html") - self.create(type: 'MessageTemplate::IssueAssigned', sys_notice: '{nickname1}在 {nickname2}/{repository} 指派给你一个疑修:{title}', notification_url: '{baseurl}/{owner}/{identifier}/issues/{id}', email: email_html, email_title: 'GitLink: {nickname1} 在 {nickname2}/{repository} 指派给你一个疑修') + self.create(type: 'MessageTemplate::IssueAssigned', sys_notice: '{nickname1}在 {nickname2}/{repository} 指派给你一个疑修:{title}', notification_url: '{baseurl}/{owner}/{identifier}/issues/{id}', email: email_html, email_title: "#{PLATFORM}: {nickname1} 在 {nickname2}/{repository} 指派给你一个疑修") self.create(type: 'MessageTemplate::IssueAtme', sys_notice: '{nickname} 在疑修 {title} 中@我', notification_url: '{baseurl}/{owner}/{identifier}/issues/{id}') email_html = File.read("#{email_template_html_dir}/issue_changed.html") - self.create(type: 'MessageTemplate::IssueChanged', sys_notice: '在项目 {nickname2}/{repository} 的疑修 {title} 中:{ifassigner}{nickname1}将负责人从 {assigner1} 修改为 {assigner2} {endassigner}{ifstatus}{nickname1}将状态从 {status1} 修改为 {status2} {endstatus}{iftracker}{nickname1}将类型从 {tracker1} 修改为 {tracker2} {endtracker}{ifpriority}{nickname1}将优先级从 {priority1} 修改为 {priority2} {endpriority}{ifmilestone}{nickname1}将里程碑从 {milestone1} 修改为 {milestone2} {endmilestone}{iftag}{nickname1}将标记从 {tag1} 修改为 {tag2} {endtag}{ifdoneratio}{nickname1}将完成度从 {doneratio1} 修改为 {doneratio2} {enddoneratio}{ifbranch}{nickname1}将指定分支从 {branch1} 修改为 {branch2} {endbranch}{ifstartdate}{nickname1}将开始日期从 {startdate1} 修改为 {startdate2} {endstartdate}{ifduedate}{nickname1}将结束日期从 {duedate1} 修改为 {duedate2} {endduedate}', email: email_html, email_title: 'GitLink: 疑修 {title} 有状态变更', notification_url: '{baseurl}/{owner}/{identifier}/issues/{id}') + self.create(type: 'MessageTemplate::IssueChanged', sys_notice: '在项目 {nickname2}/{repository} 的疑修 {title} 中:{ifassigner}{nickname1}将负责人从 {assigner1} 修改为 {assigner2} {endassigner}{ifstatus}{nickname1}将状态从 {status1} 修改为 {status2} {endstatus}{iftracker}{nickname1}将类型从 {tracker1} 修改为 {tracker2} {endtracker}{ifpriority}{nickname1}将优先级从 {priority1} 修改为 {priority2} {endpriority}{ifmilestone}{nickname1}将里程碑从 {milestone1} 修改为 {milestone2} {endmilestone}{iftag}{nickname1}将标记从 {tag1} 修改为 {tag2} {endtag}{ifdoneratio}{nickname1}将完成度从 {doneratio1} 修改为 {doneratio2} {enddoneratio}{ifbranch}{nickname1}将指定分支从 {branch1} 修改为 {branch2} {endbranch}{ifstartdate}{nickname1}将开始日期从 {startdate1} 修改为 {startdate2} {endstartdate}{ifduedate}{nickname1}将结束日期从 {duedate1} 修改为 {duedate2} {endduedate}', email: email_html, email_title: "#{PLATFORM}: 疑修 {title} 有状态变更", notification_url: '{baseurl}/{owner}/{identifier}/issues/{id}') email_html = File.read("#{email_template_html_dir}/issue_expire.html") - self.create(type: 'MessageTemplate::IssueExpire', sys_notice: '疑修 {title} 已临近截止日期,请尽快处理', notification_url: '{baseurl}/{owner}/{identifier}/issues/{id}', email: email_html, email_title: 'GitLink: 疑修截止日期到达最后一天') + self.create(type: 'MessageTemplate::IssueExpire', sys_notice: '疑修 {title} 已临近截止日期,请尽快处理', notification_url: '{baseurl}/{owner}/{identifier}/issues/{id}', email: email_html, email_title: "#{PLATFORM}: 疑修截止日期到达最后一天") email_html = File.read("#{email_template_html_dir}/issue_deleted.html") - self.create(type: 'MessageTemplate::IssueDeleted', sys_notice: '{nickname}已将疑修 {title} 删除', email: email_html, email_title: 'GitLink: 疑修 {title} 有状态变更', notification_url: '') + self.create(type: 'MessageTemplate::IssueDeleted', sys_notice: '{nickname}已将疑修 {title} 删除', email: email_html, email_title: "#{PLATFORM}: 疑修 {title} 有状态变更", notification_url: '') self.create(type: 'MessageTemplate::IssueJournal', sys_notice: '{nickname}评论疑修{title}:{notes}', notification_url: '{baseurl}/{owner}/{identifier}/issues/{id}') self.create(type: 'MessageTemplate::LoginIpTip', sys_notice: '您的账号{nickname}于{login_time)在非常用的IP地址{ip}登录,如非本人操作,请立即修改密码', notification_url: '') email_html = File.read("#{email_template_html_dir}/organization_joined.html") - self.create(type: 'MessageTemplate::OrganizationJoined', sys_notice: '你已加入 {organization} 组织', notification_url: '{baseurl}/{login}', email: email_html, email_title: 'GitLink: 你已加入 {organization} 组织') + self.create(type: 'MessageTemplate::OrganizationJoined', sys_notice: '你已加入 {organization} 组织', notification_url: '{baseurl}/{login}', email: email_html, email_title: "#{PLATFORM}: 你已加入 {organization} 组织") email_html = File.read("#{email_template_html_dir}/organization_left.html") - self.create(type: 'MessageTemplate::OrganizationLeft', sys_notice: '你已被移出 {organization} 组织', notification_url: '', email: email_html, email_title: 'GitLink: 你已被移出 {organization} 组织') + self.create(type: 'MessageTemplate::OrganizationLeft', sys_notice: '你已被移出 {organization} 组织', notification_url: '', email: email_html, email_title: "#{PLATFORM}: 你已被移出 {organization} 组织") self.create(type: 'MessageTemplate::ProjectDeleted', sys_notice: '你关注的仓库{nickname}/{repository}已被删除', notification_url: '') self.create(type: 'MessageTemplate::ProjectFollowed', sys_notice: '{nickname} 关注了你管理的仓库', notification_url: '{baseurl}/{login}') self.create(type: 'MessageTemplate::ProjectForked', sys_notice: '{nickname1} 复刻了你管理的仓库 {nickname2}/{repository}{nickname1}/{repository}', notification_url: '{baseurl}/{owner}/{identifier}') email_html = File.read("#{email_template_html_dir}/project_issue.html") - self.create(type: 'MessageTemplate::ProjectIssue', sys_notice: '{nickname1}在 {nickname2}/{repository} 新建疑修:{title}', notification_url: '{baseurl}/{owner}/{identifier}/issues/{id}', email: email_html, email_title: 'GitLink: {nickname1} 在 {nickname2}/{repository} 新建了一个疑修') + self.create(type: 'MessageTemplate::ProjectIssue', sys_notice: '{nickname1}在 {nickname2}/{repository} 新建疑修:{title}', notification_url: '{baseurl}/{owner}/{identifier}/issues/{id}', email: email_html, email_title: "#{PLATFORM}: {nickname1} 在 {nickname2}/{repository} 新建了一个疑修") email_html = File.read("#{email_template_html_dir}/project_joined.html") - self.create(type: 'MessageTemplate::ProjectJoined', sys_notice: '你已加入 {repository} 项目', notification_url: '{baseurl}/{owner}/{identifier}', email: email_html, email_title: 'GitLink: 你已加入 {repository} 项目') + self.create(type: 'MessageTemplate::ProjectJoined', sys_notice: '你已加入 {repository} 项目', notification_url: '{baseurl}/{owner}/{identifier}', email: email_html, email_title: "#{PLATFORM}: 你已加入 {repository} 项目") email_html = File.read("#{email_template_html_dir}/project_left.html") - self.create(type: 'MessageTemplate::ProjectLeft', sys_notice: '你已被移出 {repository} 项目', notification_url: '', email: email_html, email_title: 'GitLink: 你已被移出 {repository} 项目') + self.create(type: 'MessageTemplate::ProjectLeft', sys_notice: '你已被移出 {repository} 项目', notification_url: '', email: email_html, email_title: "#{PLATFORM}: 你已被移出 {repository} 项目") email_html = File.read("#{email_template_html_dir}/project_member_joined.html") - self.create(type: 'MessageTemplate::ProjectMemberJoined', sys_notice: '{nickname1} 已加入项目 {nickname2}/{repository}', notification_url: '{baseurl}/{owner}/{identifier}', email: email_html, email_title: 'GitLink: {nickname1} 已加入项目 {nickname2}/{repository}') + self.create(type: 'MessageTemplate::ProjectMemberJoined', sys_notice: '{nickname1} 已加入项目 {nickname2}/{repository}', notification_url: '{baseurl}/{owner}/{identifier}', email: email_html, email_title: "#{PLATFORM}: {nickname1} 已加入项目 {nickname2}/{repository}") email_html = File.read("#{email_template_html_dir}/project_member_left.html") - self.create(type: 'MessageTemplate::ProjectMemberLeft', sys_notice: '{nickname1} 已被移出项目 {nickname2}/{repository}', notification_url: '{baseurl}/{owner}/{identifier}', email: email_html, email_title: 'GitLink: {nickname1} 已被移出项目 {nickname2}/{repository}') + self.create(type: 'MessageTemplate::ProjectMemberLeft', sys_notice: '{nickname1} 已被移出项目 {nickname2}/{repository}', notification_url: '{baseurl}/{owner}/{identifier}', email: email_html, email_title: "#{PLATFORM}: {nickname1} 已被移出项目 {nickname2}/{repository}") email_html = File.read("#{email_template_html_dir}/project_milestone.html") - self.create(type: 'MessageTemplate::ProjectMilestone', sys_notice: '{nickname1}在 {nickname2}/{repository} 创建了一个里程碑:{name}', notification_url: '{baseurl}/{owner}/{identifier}/milestones/{id}', email: email_html, email_title: 'GitLink: {nickname1} 在 {nickname2}/{repository} 新建了一个里程碑') + self.create(type: 'MessageTemplate::ProjectMilestone', sys_notice: '{nickname1}在 {nickname2}/{repository} 创建了一个里程碑:{name}', notification_url: '{baseurl}/{owner}/{identifier}/milestones/{id}', email: email_html, email_title: "#{PLATFORM}: {nickname1} 在 {nickname2}/{repository} 新建了一个里程碑") email_html = File.read("#{email_template_html_dir}/project_milestone_completed.html") - self.create(type: 'MessageTemplate::ProjectMilestoneCompleted', sys_notice: '在 {nickname}/{repository} 仓库,里程碑 {name} 的完成度已达到100%', notification_url: '{baseurl}/{owner}/{identifier}/milestones/{id}', email: email_html, email_title: 'GitLink: 仓库 {nickname}/{repository} 有里程碑已完成') + self.create(type: 'MessageTemplate::ProjectMilestoneCompleted', sys_notice: '在 {nickname}/{repository} 仓库,里程碑 {name} 的完成度已达到100%', notification_url: '{baseurl}/{owner}/{identifier}/milestones/{id}', email: email_html, email_title: "#{PLATFORM}: 仓库 {nickname}/{repository} 有里程碑已完成") self.create(type: 'MessageTemplate::ProjectPraised', sys_notice: '{nickname1} 点赞了你管理的仓库 {nickname2}/{repository}', notification_url: '{baseurl}/{login}') email_html = File.read("#{email_template_html_dir}/project_pull_request.html") - self.create(type: 'MessageTemplate::ProjectPullRequest', sys_notice: '{nickname1}在 {nickname2}/{repository} 提交了一个合并请求:{title}', notification_url: '{baseurl}/{owner}/{identifier}/pulls/{id}', email: email_html, email_title: 'GitLink: {nickname1} 在 {nickname2}/{repository} 提交了一个合并请求') + self.create(type: 'MessageTemplate::ProjectPullRequest', sys_notice: '{nickname1}在 {nickname2}/{repository} 提交了一个合并请求:{title}', notification_url: '{baseurl}/{owner}/{identifier}/pulls/{id}', email: email_html, email_title: "#{PLATFORM}: {nickname1} 在 {nickname2}/{repository} 提交了一个合并请求") email_html = File.read("#{email_template_html_dir}/project_role.html") - self.create(type: 'MessageTemplate::ProjectRole', sys_notice: '仓库 {nickname}/{repository} 已把你的角色改为 {role}', email: email_html, email_title: 'GitLink: 在 {nickname}/{repository} 项目你的账号有权限变更', notification_url: '{baseurl}/{owner}/{identifier}') + self.create(type: 'MessageTemplate::ProjectRole', sys_notice: '仓库 {nickname}/{repository} 已把你的角色改为 {role}', email: email_html, email_title: '#{PLATFORM}: 在 {nickname}/{repository} 项目你的账号有权限变更', notification_url: '{baseurl}/{owner}/{identifier}') email_html = File.read("#{email_template_html_dir}/project_setting_changed.html") - self.create(type: 'MessageTemplate::ProjectSettingChanged', sys_notice: '{nickname1}更改了 {nickname2}/{repository} 仓库设置:{ifname}更改项目名称为"{name}"{endname}{ifidentifier}更改项目标识为"{identifier}"{endidentifier}{ifdescription}更改项目简介为"{description}"{enddescription}{ifcategory}更改项目类别为"{category}"{endcategory}{iflanguage}更改项目语言为"{language}"{endlanguage}{ifpermission}将仓库设为"{permission}"{endpermission}{ifnavbar}将项目导航更改为"{navbar}"{endnavbar}', notification_url: '{baseurl}/{owner}/{identifier}/settings', email: email_html, email_title: 'GitLink: 您管理的仓库 {nickname2}/{repository} 仓库设置已被更改') + self.create(type: 'MessageTemplate::ProjectSettingChanged', sys_notice: '{nickname1}更改了 {nickname2}/{repository} 仓库设置:{ifname}更改项目名称为"{name}"{endname}{ifidentifier}更改项目标识为"{identifier}"{endidentifier}{ifdescription}更改项目简介为"{description}"{enddescription}{ifcategory}更改项目类别为"{category}"{endcategory}{iflanguage}更改项目语言为"{language}"{endlanguage}{ifpermission}将仓库设为"{permission}"{endpermission}{ifnavbar}将项目导航更改为"{navbar}"{endnavbar}', notification_url: '{baseurl}/{owner}/{identifier}/settings', email: email_html, email_title: "#{PLATFORM}: 您管理的仓库 {nickname2}/{repository} 仓库设置已被更改") self.create(type: 'MessageTemplate::ProjectTransfer', sys_notice: '你关注的仓库{nickname1}/{repository1}已被转移至{nickname2}/{repository2}', notification_url: '{baseurl}/{owner}/{identifier}') self.create(type: 'MessageTemplate::ProjectVersion', sys_notice: '{nickname1}在 {nickname2}/{repository} 创建了发行版:{title}', notification_url: '{baseurl}/{owner}/{identifier}/releases') email_html = File.read("#{email_template_html_dir}/pull_request_assigned.html") - self.create(type: 'MessageTemplate::PullRequestAssigned', sys_notice: '{nickname1}在 {nickname2}/{repository} 指派给你一个合并请求:{title}', notification_url: '{baseurl}/{owner}/{identifier}/pulls/{id}', email: email_html, email_title: 'GitLink: {nickname1} 在 {nickname2}/{repository} 指派给你一个合并请求') + self.create(type: 'MessageTemplate::PullRequestAssigned', sys_notice: '{nickname1}在 {nickname2}/{repository} 指派给你一个合并请求:{title}', notification_url: '{baseurl}/{owner}/{identifier}/pulls/{id}', email: email_html, email_title: "#{PLATFORM}: {nickname1} 在 {nickname2}/{repository} 指派给你一个合并请求") self.create(type: 'MessageTemplate::PullRequestAtme', sys_notice: '{nickname} 在合并请求 {title} 中@我', notification_url: '{baseurl}/{owner}/{identifier}/pulls/{id}') email_html = File.read("#{email_template_html_dir}/pull_request_changed.html") - self.create(type: 'MessageTemplate::PullRequestChanged', sys_notice: '在项目{nickname2}/{repository}的合并请求 {title} 中:{ifassigner}{nickname1}将审查成员从 {assigner1} 修改为 {assigner2} {endassigner}{ifmilestone}{nickname1}将里程碑从 {milestone1} 修改为 {milestone2} {endmilestone}{iftag}{nickname1}将标记从 {tag1} 修改为 {tag2} {endtag}{ifpriority}{nickname1}将优先级从 {priority1} 修改为 {priority2} {endpriority}', email: email_html, email_title: 'GitLink: 合并请求 {title} 有状态变更', notification_url: '{baseurl}/{owner}/{identifier}/pulls/{id}') + self.create(type: 'MessageTemplate::PullRequestChanged', sys_notice: '在项目{nickname2}/{repository}的合并请求 {title} 中:{ifassigner}{nickname1}将审查成员从 {assigner1} 修改为 {assigner2} {endassigner}{ifmilestone}{nickname1}将里程碑从 {milestone1} 修改为 {milestone2} {endmilestone}{iftag}{nickname1}将标记从 {tag1} 修改为 {tag2} {endtag}{ifpriority}{nickname1}将优先级从 {priority1} 修改为 {priority2} {endpriority}', email: email_html, email_title: "#{PLATFORM}: 合并请求 {title} 有状态变更", notification_url: '{baseurl}/{owner}/{identifier}/pulls/{id}') email_html = File.read("#{email_template_html_dir}/pull_request_closed.html") - self.create(type: 'MessageTemplate::PullRequestClosed', sys_notice: '你提交的合并请求:{title} 被拒绝', email: email_html, email_title: 'GitLink: 合并请求 {title} 有状态变更', notification_url: '') + self.create(type: 'MessageTemplate::PullRequestClosed', sys_notice: '你提交的合并请求:{title} 被拒绝', email: email_html, email_title: "#{PLATFORM}: 合并请求 {title} 有状态变更", notification_url: '') self.create(type: 'MessageTemplate::PullRequestJournal', sys_notice: '{nickname}评论合并请求{title}:{notes}', notification_url: '{baseurl}/{owner}/{identifier}/pulls/{id}') email_html = File.read("#{email_template_html_dir}/pull_request_merged.html") - self.create(type: 'MessageTemplate::PullRequestMerged', sys_notice: '你提交的合并请求:{title} 已通过', email: email_html, email_title: 'GitLink: 合并请求 {title} 有状态变更', notification_url: '{baseurl}/{owner}/{identifier}/pulls/{id}') + self.create(type: 'MessageTemplate::PullRequestMerged', sys_notice: '你提交的合并请求:{title} 已通过', email: email_html, email_title: "#{PLATFORM}: 合并请求 {title} 有状态变更", notification_url: '{baseurl}/{owner}/{identifier}/pulls/{id}') email_html = File.read("#{email_template_html_dir}/team_joined.html") - self.create(type: 'MessageTemplate::TeamJoined', sys_notice: '你已被拉入组织 {organization}{team} 团队,拥有{role}权限', email: email_html, email_title: 'GitLink: 在 {organization} 组织你的账号有权限变更', notification_url: '{baseurl}/{login}') + self.create(type: 'MessageTemplate::TeamJoined', sys_notice: '你已被拉入组织 {organization}{team} 团队,拥有{role}权限', email: email_html, email_title: "#{PLATFORM}: 在 {organization} 组织你的账号有权限变更", notification_url: '{baseurl}/{login}') email_html = File.read("#{email_template_html_dir}/team_left.html") - self.create(type: 'MessageTemplate::TeamLeft', sys_notice: '你已被移出组织 {organization}{team} 团队', email: email_html, email_title: 'GitLink: 在 {organization} 组织你的账号有权限变更', notification_url: '{baseurl}/{login}') + self.create(type: 'MessageTemplate::TeamLeft', sys_notice: '你已被移出组织 {organization}{team} 团队', email: email_html, email_title: "#{PLATFORM}: 在 {organization} 组织你的账号有权限变更", notification_url: '{baseurl}/{login}') end def self.sys_notice diff --git a/app/models/message_template/issue_assigned.rb b/app/models/message_template/issue_assigned.rb index 7ce7f10c..7f8494f6 100644 --- a/app/models/message_template/issue_assigned.rb +++ b/app/models/message_template/issue_assigned.rb @@ -53,6 +53,7 @@ class MessageTemplate::IssueAssigned < MessageTemplate content.gsub!('{baseurl}', base_url) content.gsub!('{title}', issue&.subject) content.gsub!('{id}', issue&.id.to_s) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/issue_changed.rb b/app/models/message_template/issue_changed.rb index 4d9e132c..e8a5e5cd 100644 --- a/app/models/message_template/issue_changed.rb +++ b/app/models/message_template/issue_changed.rb @@ -359,6 +359,7 @@ class MessageTemplate::IssueChanged < MessageTemplate else content.gsub!(/({ifduedate})(.*)({endduedate})/, '') end + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/issue_deleted.rb b/app/models/message_template/issue_deleted.rb index a3eae75d..599cc235 100644 --- a/app/models/message_template/issue_deleted.rb +++ b/app/models/message_template/issue_deleted.rb @@ -41,6 +41,7 @@ class MessageTemplate::IssueDeleted < MessageTemplate content.gsub!('{login}', operator&.login) content.gsub!('{baseurl}', base_url) content.gsub!('{title}', issue_title) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/issue_expire.rb b/app/models/message_template/issue_expire.rb index 1f48c563..88593d84 100644 --- a/app/models/message_template/issue_expire.rb +++ b/app/models/message_template/issue_expire.rb @@ -48,6 +48,7 @@ class MessageTemplate::IssueExpire < MessageTemplate content.gsub!('{baseurl}', base_url) content.gsub!('{title}', issue&.subject) content.gsub!('{id}', issue&.id.to_s) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/organization_joined.rb b/app/models/message_template/organization_joined.rb index 30f91ac9..daa3f0fe 100644 --- a/app/models/message_template/organization_joined.rb +++ b/app/models/message_template/organization_joined.rb @@ -41,6 +41,7 @@ class MessageTemplate::OrganizationJoined < MessageTemplate content.gsub!('{baseurl}', base_url) content.gsub!('{login}', organization&.login) content.gsub!('{organization}', organization&.real_name) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/organization_left.rb b/app/models/message_template/organization_left.rb index 50a77138..f21982e9 100644 --- a/app/models/message_template/organization_left.rb +++ b/app/models/message_template/organization_left.rb @@ -41,6 +41,7 @@ class MessageTemplate::OrganizationLeft < MessageTemplate content.gsub!('{baseurl}', base_url) content.gsub!('{login}', organization&.login) content.gsub!('{organization}', organization&.real_name) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/organization_role.rb b/app/models/message_template/organization_role.rb index 20771295..3919dc94 100644 --- a/app/models/message_template/organization_role.rb +++ b/app/models/message_template/organization_role.rb @@ -43,6 +43,7 @@ class MessageTemplate::OrganizationRole < MessageTemplate content.gsub!('{login}', organization&.login) content.gsub!('{organization}', organization&.real_name) content.gsub!('{role}', role) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/project_issue.rb b/app/models/message_template/project_issue.rb index 5904a428..e0483083 100644 --- a/app/models/message_template/project_issue.rb +++ b/app/models/message_template/project_issue.rb @@ -56,6 +56,7 @@ class MessageTemplate::ProjectIssue < MessageTemplate content.gsub!('{identifier}', project&.identifier) content.gsub!('{id}', issue&.id.to_s) content.gsub!('{title}', issue&.subject) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/project_joined.rb b/app/models/message_template/project_joined.rb index c2d23fbd..1f83c312 100644 --- a/app/models/message_template/project_joined.rb +++ b/app/models/message_template/project_joined.rb @@ -44,6 +44,7 @@ class MessageTemplate::ProjectJoined < MessageTemplate content.gsub!('{identifier}', project&.identifier) content.gsub!('{nickname}', project&.owner&.real_name) content.gsub!('{repository}', project&.name) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/project_left.rb b/app/models/message_template/project_left.rb index 6f5bafa0..4df14c15 100644 --- a/app/models/message_template/project_left.rb +++ b/app/models/message_template/project_left.rb @@ -43,6 +43,7 @@ class MessageTemplate::ProjectLeft < MessageTemplate content.gsub!('{identifier}', project&.identifier) content.gsub!('{nickname}', project&.owner&.real_name) content.gsub!('{repository}', project&.name) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/project_member_joined.rb b/app/models/message_template/project_member_joined.rb index e9b6b5d5..4c0a77a0 100644 --- a/app/models/message_template/project_member_joined.rb +++ b/app/models/message_template/project_member_joined.rb @@ -48,6 +48,7 @@ class MessageTemplate::ProjectMemberJoined < MessageTemplate content.gsub!('{nickname1}', user&.real_name) content.gsub!('{nickname2}', project&.owner&.real_name) content.gsub!('{repository}', project&.name) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/project_member_left.rb b/app/models/message_template/project_member_left.rb index 23d4ef5f..d1891e7b 100644 --- a/app/models/message_template/project_member_left.rb +++ b/app/models/message_template/project_member_left.rb @@ -48,6 +48,7 @@ class MessageTemplate::ProjectMemberLeft < MessageTemplate content.gsub!('{nickname1}', user&.real_name) content.gsub!('{nickname2}', project&.owner&.real_name) content.gsub!('{repository}', project&.name) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/project_milestone.rb b/app/models/message_template/project_milestone.rb index c2560c0a..7f1f94d9 100644 --- a/app/models/message_template/project_milestone.rb +++ b/app/models/message_template/project_milestone.rb @@ -55,6 +55,7 @@ class MessageTemplate::ProjectMilestone < MessageTemplate content.gsub!('{identifier}', project&.identifier) content.gsub!('{id}', milestone&.id.to_s) content.gsub!('{name}', milestone&.name) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/project_milestone_completed.rb b/app/models/message_template/project_milestone_completed.rb index 877bf033..eec895a6 100644 --- a/app/models/message_template/project_milestone_completed.rb +++ b/app/models/message_template/project_milestone_completed.rb @@ -52,6 +52,7 @@ class MessageTemplate::ProjectMilestoneCompleted < MessageTemplate content.gsub!('{identifier}', project&.identifier) content.gsub!('{id}', milestone&.id.to_s) content.gsub!('{name}', milestone&.name) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/project_pull_request.rb b/app/models/message_template/project_pull_request.rb index 40c700b2..f36ac086 100644 --- a/app/models/message_template/project_pull_request.rb +++ b/app/models/message_template/project_pull_request.rb @@ -56,6 +56,7 @@ class MessageTemplate::ProjectPullRequest < MessageTemplate content.gsub!('{identifier}', project&.identifier) content.gsub!('{id}', pull_request&.id.to_s) content.gsub!('{title}', pull_request&.title) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/project_role.rb b/app/models/message_template/project_role.rb index f7f4940d..560f345e 100644 --- a/app/models/message_template/project_role.rb +++ b/app/models/message_template/project_role.rb @@ -46,6 +46,7 @@ class MessageTemplate::ProjectRole < MessageTemplate content.gsub!('{identifier}', project&.identifier) content.gsub!('{repository}', project&.name) content.gsub!('{role}', role) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/project_setting_changed.rb b/app/models/message_template/project_setting_changed.rb index 49cf7821..0920dfe7 100644 --- a/app/models/message_template/project_setting_changed.rb +++ b/app/models/message_template/project_setting_changed.rb @@ -300,6 +300,7 @@ class MessageTemplate::ProjectSettingChanged < MessageTemplate else content.gsub!(/({ifnavbar})(.*)({endnavbar})/, '') end + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/pull_request_assigned.rb b/app/models/message_template/pull_request_assigned.rb index bca37151..642ca912 100644 --- a/app/models/message_template/pull_request_assigned.rb +++ b/app/models/message_template/pull_request_assigned.rb @@ -53,6 +53,7 @@ class MessageTemplate::PullRequestAssigned < MessageTemplate content.gsub!('{baseurl}', base_url) content.gsub!('{title}', pull_request&.title) content.gsub!('{id}', pull_request&.id.to_s) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/pull_request_changed.rb b/app/models/message_template/pull_request_changed.rb index ab2c73b6..a2071c23 100644 --- a/app/models/message_template/pull_request_changed.rb +++ b/app/models/message_template/pull_request_changed.rb @@ -118,6 +118,7 @@ class MessageTemplate::PullRequestChanged < MessageTemplate content.gsub!('{baseurl}', base_url) content.gsub!('{title}', pull_request&.title) content.gsub!('{id}', pull_request&.id.to_s) + content.gsub!('{platform}', PLATFORM) change_count = change_params.keys.size # 合并请求审查成员修改 diff --git a/app/models/message_template/pull_request_closed.rb b/app/models/message_template/pull_request_closed.rb index ea1ffabc..cb8b1b74 100644 --- a/app/models/message_template/pull_request_closed.rb +++ b/app/models/message_template/pull_request_closed.rb @@ -51,6 +51,7 @@ class MessageTemplate::PullRequestClosed < MessageTemplate content.gsub!('{baseurl}', base_url) content.gsub!('{title}', pull_request&.title) content.gsub!('{id}', pull_request&.id.to_s) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/pull_request_merged.rb b/app/models/message_template/pull_request_merged.rb index eb4bb5e1..384cf8f1 100644 --- a/app/models/message_template/pull_request_merged.rb +++ b/app/models/message_template/pull_request_merged.rb @@ -51,6 +51,7 @@ class MessageTemplate::PullRequestMerged < MessageTemplate content.gsub!('{baseurl}', base_url) content.gsub!('{title}', pull_request&.title) content.gsub!('{id}', pull_request&.id.to_s) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/team_joined.rb b/app/models/message_template/team_joined.rb index f4994095..90f153d9 100644 --- a/app/models/message_template/team_joined.rb +++ b/app/models/message_template/team_joined.rb @@ -45,6 +45,7 @@ class MessageTemplate::TeamJoined < MessageTemplate content.gsub!('{organization}', organization&.real_name) content.gsub!('{team}', team&.nickname) content.gsub!('{role}', team&.authorize_name) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/app/models/message_template/team_left.rb b/app/models/message_template/team_left.rb index 57242263..1618f41b 100644 --- a/app/models/message_template/team_left.rb +++ b/app/models/message_template/team_left.rb @@ -45,6 +45,7 @@ class MessageTemplate::TeamLeft < MessageTemplate content.gsub!('{organization}', organization&.real_name) content.gsub!('{team}', team&.nickname) content.gsub!('{role}', team&.authorize_name) + content.gsub!('{platform}', PLATFORM) return receiver&.mail, title, content else diff --git a/public/message_template/issue_assigned.html b/public/message_template/issue_assigned.html index c45e8729..c45bb6ee 100755 --- a/public/message_template/issue_assigned.html +++ b/public/message_template/issue_assigned.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/issue_changed.html b/public/message_template/issue_changed.html index 537a12dc..db696a0c 100755 --- a/public/message_template/issue_changed.html +++ b/public/message_template/issue_changed.html @@ -48,7 +48,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/issue_deleted.html b/public/message_template/issue_deleted.html index 4207144c..335fdfbc 100755 --- a/public/message_template/issue_deleted.html +++ b/public/message_template/issue_deleted.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/issue_expire.html b/public/message_template/issue_expire.html index 641742bb..34701a0a 100644 --- a/public/message_template/issue_expire.html +++ b/public/message_template/issue_expire.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/organization_joined.html b/public/message_template/organization_joined.html index e3848f47..7d50ebdb 100755 --- a/public/message_template/organization_joined.html +++ b/public/message_template/organization_joined.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/organization_left.html b/public/message_template/organization_left.html index 32b1dc30..b2eeffbb 100755 --- a/public/message_template/organization_left.html +++ b/public/message_template/organization_left.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/organization_role.html b/public/message_template/organization_role.html index b411c734..ad597dea 100755 --- a/public/message_template/organization_role.html +++ b/public/message_template/organization_role.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/project_issue.html b/public/message_template/project_issue.html index 653bd7a3..4b6812fc 100755 --- a/public/message_template/project_issue.html +++ b/public/message_template/project_issue.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/project_joined.html b/public/message_template/project_joined.html index dfafd5d9..fa8f0771 100755 --- a/public/message_template/project_joined.html +++ b/public/message_template/project_joined.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/project_left.html b/public/message_template/project_left.html index 94a0e986..81453d22 100755 --- a/public/message_template/project_left.html +++ b/public/message_template/project_left.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/project_member_joined.html b/public/message_template/project_member_joined.html index d2fec456..b22ced2d 100755 --- a/public/message_template/project_member_joined.html +++ b/public/message_template/project_member_joined.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/project_member_left.html b/public/message_template/project_member_left.html index 8dfca4a2..d1a8b044 100755 --- a/public/message_template/project_member_left.html +++ b/public/message_template/project_member_left.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/project_milestone.html b/public/message_template/project_milestone.html index 6f1a4b11..0b2a0725 100644 --- a/public/message_template/project_milestone.html +++ b/public/message_template/project_milestone.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/project_milestone_completed.html b/public/message_template/project_milestone_completed.html index 89960e3c..6b62a8cb 100644 --- a/public/message_template/project_milestone_completed.html +++ b/public/message_template/project_milestone_completed.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/project_pull_request.html b/public/message_template/project_pull_request.html index 78aa5c2d..fe389e98 100755 --- a/public/message_template/project_pull_request.html +++ b/public/message_template/project_pull_request.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/project_role.html b/public/message_template/project_role.html index 17f53e37..3e8e8b55 100755 --- a/public/message_template/project_role.html +++ b/public/message_template/project_role.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/project_setting_changed.html b/public/message_template/project_setting_changed.html index 4d1f9762..ecea17ef 100755 --- a/public/message_template/project_setting_changed.html +++ b/public/message_template/project_setting_changed.html @@ -45,7 +45,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/pull_request_assigned.html b/public/message_template/pull_request_assigned.html index c12924d1..1d181061 100755 --- a/public/message_template/pull_request_assigned.html +++ b/public/message_template/pull_request_assigned.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/pull_request_changed.html b/public/message_template/pull_request_changed.html index ab9c3f6a..ccbefad9 100755 --- a/public/message_template/pull_request_changed.html +++ b/public/message_template/pull_request_changed.html @@ -42,7 +42,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/pull_request_closed.html b/public/message_template/pull_request_closed.html index dca5e1c7..c860a54a 100755 --- a/public/message_template/pull_request_closed.html +++ b/public/message_template/pull_request_closed.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/pull_request_merged.html b/public/message_template/pull_request_merged.html index 8c6e3469..59812ddd 100755 --- a/public/message_template/pull_request_merged.html +++ b/public/message_template/pull_request_merged.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/team_joined.html b/public/message_template/team_joined.html index 231f8b79..36610f72 100755 --- a/public/message_template/team_joined.html +++ b/public/message_template/team_joined.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队

diff --git a/public/message_template/team_left.html b/public/message_template/team_left.html index 1321e7b4..ea2cce64 100755 --- a/public/message_template/team_left.html +++ b/public/message_template/team_left.html @@ -38,7 +38,7 @@

如果您在使用中有任何的疑问和建议,欢迎您给我们反馈意见
QQ群:1071514693

-

GitLink团队

+

{platform}团队