From 36aa17bd1a298e3733dce072018014582fd41676 Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Fri, 10 Nov 2023 17:14:38 +0800 Subject: [PATCH] update --- fs_template/test.tpl | 116 +++++++++++++++++++ model/gmodel/fs_message_log_gen.go | 3 +- model/gmodel/var_gen.go | 6 - server/auth/internal/logic/websocket_test.go | 57 +++++---- 4 files changed, 149 insertions(+), 33 deletions(-) create mode 100644 fs_template/test.tpl diff --git a/fs_template/test.tpl b/fs_template/test.tpl new file mode 100644 index 00000000..57275e8a --- /dev/null +++ b/fs_template/test.tpl @@ -0,0 +1,116 @@ +Subject: Please confirm your {{ .CompanyName }} account; +MIME-version: 1.0; +Content-Type: text/html; charset="UTF-8"; +From: "Fusen Support"; + + + + + + + + 订单状态流转 + + + +
+
+

+
+
+

The status of your order has changed!

+

+ Your order has been changed from "原状态" to "现状态".

+ Check Your Order +
+
+
+

Search Logo, Get Design

+

Our products

+

Try it out

+
+ + support@fusenpack.com +
+ Unsubscribe +
+
+
+ + \ No newline at end of file diff --git a/model/gmodel/fs_message_log_gen.go b/model/gmodel/fs_message_log_gen.go index 07be29a2..cb9b8fe5 100644 --- a/model/gmodel/fs_message_log_gen.go +++ b/model/gmodel/fs_message_log_gen.go @@ -1,9 +1,8 @@ package gmodel import ( - "time" - "gorm.io/gorm" + "time" ) // fs_message_log 消息记录表 diff --git a/model/gmodel/var_gen.go b/model/gmodel/var_gen.go index 4b7122fd..b2b073d8 100644 --- a/model/gmodel/var_gen.go +++ b/model/gmodel/var_gen.go @@ -119,10 +119,7 @@ type AllModelsGen struct { FsUserStock *FsUserStockModel // fs_user_stock 用户云仓库存 FsWebSet *FsWebSetModel // fs_web_set 网站配置表 FsZipCode *FsZipCodeModel // fs_zip_code 邮编表 - LdapApis *LdapApisModel // ldap_apis LdapCasbinRule *LdapCasbinRuleModel // ldap_casbin_rule 规则权限表 - LdapMenus *LdapMenusModel // ldap_menus - LdapUsers *LdapUsersModel // ldap_users } @@ -243,10 +240,7 @@ func NewAllModels(gdb *gorm.DB) *AllModelsGen { FsUserStock: NewFsUserStockModel(gdb), FsWebSet: NewFsWebSetModel(gdb), FsZipCode: NewFsZipCodeModel(gdb), - LdapApis: NewLdapApisModel(gdb), LdapCasbinRule: NewLdapCasbinRuleModel(gdb), - LdapMenus: NewLdapMenusModel(gdb), - LdapUsers: NewLdapUsersModel(gdb), } return models } diff --git a/server/auth/internal/logic/websocket_test.go b/server/auth/internal/logic/websocket_test.go index 17f6ba2a..089f060f 100644 --- a/server/auth/internal/logic/websocket_test.go +++ b/server/auth/internal/logic/websocket_test.go @@ -26,48 +26,55 @@ func TestEmailSend(t *testing.T) { // 设置发件人和收件人信息 from := "support@fusenpack.com" to := []string{"474420502@qq.com"} + // to := []string{"qq474420502@gmail.com"} + // to := []string{"outlook_7D27A8300A1B3F01@outlook.com"} // 设置smtp服务器地址,端口和认证信息 smtpServer := "smtp.gmail.com" auth := smtp.PlainAuth("", "support@fusenpack.com", "wfbjpdgvaozjvwah", smtpServer) - msg := []byte(`Subject: Password Reset Request for Your Account; -MIME-version: 1.0; -Content-Type: text/html; charset="UTF-8"; -From: "Fusen"; + var buf bytes.Buffer + tpls.ExecuteTemplate(&buf, "test.tpl", map[string]any{ + "CompanyName": "FusenPack", + }) + // msg := []byte(`Subject: Password Reset Request for Your Account; + // MIME-version: 1.0; + // Content-Type: text/html; charset="UTF-8"; + // From: "Fusen"; - - - Password Reset for Your {{.CompanyName}} Account - - + // + // + // Password Reset for Your {{.CompanyName}} Account + // + // -

Dear {{.UserName}},

+ //

Dear {{.UserName}},

-

We have received your request to reset the password for your {{.CompanyName}} account.

+ //

We have received your request to reset the password for your {{.CompanyName}} account.

-

To proceed with the password reset, please click the button below to open the Reset Password page:

+ //

To proceed with the password reset, please click the button below to open the Reset Password page:

-
- - Reset Password - -
+ //
+ // + // Reset Password + // + //
-

Please note that this password reset confirmation link will expire in 60 minutes. If you have any further questions, feel free to reach out to us.

+ //

Please note that this password reset confirmation link will expire in 60 minutes. If you have any further questions, feel free to reach out to us.

-

Regards,

+ //

Regards,

-

{{.SenderName}}
-{{.SenderTitle}}
-{{.CompanyName}}

+ //

{{.SenderName}}
+ // {{.SenderTitle}}
+ // {{.CompanyName}}

- -`) + // + // `) + msg := buf.Bytes() // 发送邮件 err := smtp.SendMail(smtpServer+":587", auth, from, to, msg) if err != nil {