mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-28 22:03:40 -06:00
Bazaar/Protect : send activation mail with e-mail if user name is empty
git-svn-id: svn://ultimatepp.org/upp/trunk@3186 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
b54d768d71
commit
633e417d78
1 changed files with 13 additions and 3 deletions
|
|
@ -652,14 +652,24 @@ bool ProtectServer::SendActivationMail(VectorMap<String, Value> const &userData,
|
|||
}
|
||||
else
|
||||
body.Replace(String("%ACTIVATIONKEY%"), key);
|
||||
body.Replace("%USER%", userData.Get("NAME"));
|
||||
subject.Replace("%USER%", userData.Get("NAME"));
|
||||
|
||||
String user = userData.Get("NAME");
|
||||
if(user == "")
|
||||
user = userData.Get("EMAIL");
|
||||
body.Replace(String("%USER%"), user);
|
||||
subject.Replace(String("%USER%"), user);
|
||||
|
||||
String mime;
|
||||
if(body.Find("<HTML>") >= 0 || body.Find("<html>") >= 0)
|
||||
mime = "text/html";
|
||||
else
|
||||
mime = "text/plain";
|
||||
|
||||
smtp.New();
|
||||
smtp.To(userData.Get("EMAIL"));
|
||||
smtp.Subject(subject);
|
||||
smtp.From(serverVars.Get("SERVER_NAME"));
|
||||
smtp.Text(body);
|
||||
smtp.Text(body, mime);
|
||||
return smtp.Send();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue