diff --git a/pkg/notify/models/mod_template.go b/pkg/notify/models/mod_template.go index aca9b1be47..4ab4dd3395 100644 --- a/pkg/notify/models/mod_template.go +++ b/pkg/notify/models/mod_template.go @@ -72,9 +72,13 @@ type STemplate struct { Content string `length:"text" nullable:"false" create:"required" get:"user" list:"user" update:"user"` } +const ( + verifyUrlPath = "/v2/email-verification/id/{0}/token/{1}?region=%s" +) + func (tm *STemplateManager) GetEmailUrl() string { - if len(options.Options.ApiServer) > 0 && len(options.Options.VerifyEmailUrlPath) > 0 { - return httputils.JoinPath(options.Options.ApiServer, options.Options.VerifyEmailUrlPath) + if len(options.Options.ApiServer) > 0 { + return httputils.JoinPath(options.Options.ApiServer, fmt.Sprintf(verifyUrlPath, options.Options.Region)) } return options.Options.VerifyEmailUrl } diff --git a/pkg/notify/options/options.go b/pkg/notify/options/options.go index 6928effba8..c62487f7fa 100644 --- a/pkg/notify/options/options.go +++ b/pkg/notify/options/options.go @@ -22,10 +22,10 @@ type NotifyOption struct { common_options.CommonOptions common_options.DBOptions - DingtalkEnabled bool `help:"Enable dingtalk"` - SocketFileDir string `help:"Socket file directory" default:"/etc/yunion/notify"` - UpdateInterval int `help:"Update send services interval(unit:min)" default:"30"` - VerifyEmailUrlPath string `help:"url of verify email" json:"verify_email_url_path"` + DingtalkEnabled bool `help:"Enable dingtalk"` + SocketFileDir string `help:"Socket file directory" default:"/etc/yunion/notify"` + UpdateInterval int `help:"Update send services interval(unit:min)" default:"30"` + // VerifyEmailUrlPath string `help:"url of verify email" json:"verify_email_url_path"` // Deprecated VerifyEmailUrl string `help:"url of verify email" json:"verify_email_url"`