This commit is contained in:
@ -77,7 +77,8 @@ func (c User) SendRegisterEmail(content, toEmail string) revel.Result {
|
||||
|
||||
// 发送邮件
|
||||
var userInfo = c.GetUserInfo();
|
||||
url := "http://leanote.com/register?from=" + userInfo.Username
|
||||
siteUrl, _ := revel.Config.String("site.url")
|
||||
url := siteUrl + "/register?from=" + userInfo.Username
|
||||
body := fmt.Sprintf("点击链接注册leanote: <a href='%v'>%v</a>. ", url, url);
|
||||
body = content + "<br />" + body
|
||||
re.Ok = SendEmail(toEmail, userInfo.Username + "邀请您注册leanote", "邀请注册", body)
|
||||
|
@ -2,6 +2,7 @@ package service
|
||||
|
||||
import (
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
"github.com/revel/revel"
|
||||
"github.com/leanote/leanote/app/db"
|
||||
"github.com/leanote/leanote/app/info"
|
||||
. "github.com/leanote/leanote/app/lea"
|
||||
@ -31,7 +32,8 @@ func (this *PwdService) FindPwd(email string) (ok bool, msg string) {
|
||||
}
|
||||
|
||||
// 发送邮件
|
||||
url := "http://leanote.com/findPassword/" + token
|
||||
siteUrl, _ := revel.Config.String("site.url")
|
||||
url := siteUrl + "/findPassword/" + token
|
||||
body := fmt.Sprintf("请点击链接修改密码: <a href='%v'>%v</a>. %v小时后过期.", url, url, int(overHours));
|
||||
if !SendEmail(email, "leanote-找回密码", "找回密码", body) {
|
||||
return false, "邮箱发送失败"
|
||||
|
@ -1,6 +1,7 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"github.com/revel/revel"
|
||||
"github.com/leanote/leanote/app/info"
|
||||
"github.com/leanote/leanote/app/db"
|
||||
. "github.com/leanote/leanote/app/lea"
|
||||
@ -180,7 +181,8 @@ func (this *UserService) RegisterSendActiveEmail(userId string, email string) bo
|
||||
}
|
||||
|
||||
// 发送邮件
|
||||
url := "http://leanote.com/user/activeEmail?token=" + token
|
||||
siteUrl, _ := revel.Config.String("site.url")
|
||||
url := siteUrl + "/user/activeEmail?token=" + token
|
||||
body := fmt.Sprintf("请点击链接验证邮箱: <a href='%v'>%v</a>. %v小时后过期.", url, url, tokenService.GetOverHours(info.TokenActiveEmail));
|
||||
if !SendEmail(email, "leanote-验证邮箱", "验证邮箱", body) {
|
||||
return false
|
||||
@ -208,7 +210,8 @@ func (this *UserService) UpdateEmailSendActiveEmail(userId, email string) (ok bo
|
||||
}
|
||||
|
||||
// 发送邮件
|
||||
url := "http://leanote.com/user/updateEmail?token=" + token
|
||||
siteUrl, _ := revel.Config.String("site.url")
|
||||
url := siteUrl + "/user/updateEmail?token=" + token
|
||||
body := "邮箱验证后您的登录邮箱为: <b>" + email + "</b><br />";
|
||||
body += fmt.Sprintf("请点击链接验证邮箱: <a href='%v'>%v</a>. %v小时后过期.", url, url, tokenService.GetOverHours(info.TokenUpdateEmail));
|
||||
if !SendEmail(email, "leanote-验证邮箱", "验证邮箱", body) {
|
||||
|
Reference in New Issue
Block a user