Skip to content

Commit

Permalink
email模版url可配置。
Browse files Browse the repository at this point in the history
  • Loading branch information
lanyulei committed Aug 14, 2020
1 parent 2c2c429 commit 9e56692
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/settings.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ settings:
ssl:
key: keystring
pem: temp/pem.pem
domain: http://192.168.0.100:9527
3 changes: 2 additions & 1 deletion config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ settings:
gorm:
logmode: 0
maxidleconn: 0
maxopenconn: 20000
maxopenconn: 20000
domain: http://192.168.0.100:9527
4 changes: 4 additions & 0 deletions pkg/notify/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"ferry/pkg/notify/email"
"text/template"

"github.com/spf13/viper"

log "github.com/sirupsen/logrus"
)

Expand All @@ -27,6 +29,7 @@ type BodyData struct {
Content string // 通知的内容
Description string // 表格上面的描述信息
ProcessId int // 流程ID
Domain string // 域名地址
}

func (b *BodyData) ParsingTemplate() (err error) {
Expand All @@ -40,6 +43,7 @@ func (b *BodyData) ParsingTemplate() (err error) {
return
}

b.Domain = viper.GetString("settings.domain")
err = tmpl.Execute(&buf, b)
if err != nil {
return
Expand Down
2 changes: 1 addition & 1 deletion static/template/email.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</table>

<br>
<a href="http://localhost:9527/#/process/handle-ticket?workOrderId={{ .Id }}&processId={{ .ProcessId }}" target="_blank">点击此处跳转到工单详情</a>
<a href="{{ .Domain }}/#/process/handle-ticket?workOrderId={{ .Id }}&processId={{ .ProcessId }}" target="_blank">点击此处跳转到工单详情</a>
</body>
<style>
table {
Expand Down

0 comments on commit 9e56692

Please sign in to comment.