Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
feat(email-tpl): add ip variable to email template
Browse files Browse the repository at this point in the history
Signed-off-by: qwqcode <[email protected]>
  • Loading branch information
qwqcode committed Oct 18, 2022
1 parent ddec9d2 commit 0539487
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion artalk-go.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ db:
# 数据库地址
host: "localhost"
# 数据库端口
port: "3306"
port: 3306
# 数据库账户
user: "root"
# 数据库密码
Expand Down
2 changes: 2 additions & 0 deletions model/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ type CookedCommentForEmail struct {
ContentRaw string `json:"content_raw"`
Nick string `json:"nick"`
Email string `json:"email"`
IP string `json:"ip"`
Datetime string `json:"datetime"`
Date string `json:"date"`
Time string `json:"time"`
Expand All @@ -181,6 +182,7 @@ func (c *Comment) ToCookedForEmail() CookedCommentForEmail {
ContentRaw: c.Content,
Nick: user.Name,
Email: user.Email,
IP: c.IP,
Datetime: c.CreatedAt.Local().Format("2006-01-02 15:04:05"),
Date: c.CreatedAt.Local().Format("2006-01-02"),
Time: c.CreatedAt.Local().Format("15:04:05"),
Expand Down

0 comments on commit 0539487

Please sign in to comment.