2 changed files with 508 additions and 0 deletions
-
461EuroTran/EasyBL.WEBAPP/ShowEasy/SignupService.cs
-
47EuroTran/WebApp/Controllers/SignupController.cs
@ -0,0 +1,461 @@ |
|||
|
|||
using EasyBL.WebApi; |
|||
using EasyBL.WebApi.Common; |
|||
using EasyBL.WebApi.Message; |
|||
using EasyNet; |
|||
using Entity.ShowEasyDtos; |
|||
using Entity.Sugar; |
|||
using Entity.ViewModels; |
|||
using Newtonsoft.Json; |
|||
using SqlSugar; |
|||
using SqlSugar.Base; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
using System.Linq; |
|||
using System.Net.Http; |
|||
using System.Text; |
|||
using System.Web; |
|||
using System.Net.Mail; |
|||
|
|||
namespace EasyBL.WEBAPP.SYS |
|||
{ |
|||
public class SignupService : ServiceBase |
|||
{ |
|||
public static string SERVER_IP = "localhost"; |
|||
public static string SERVER_PORT = "3466"; |
|||
|
|||
//使用者以信箱註冊(API Function)
|
|||
public HttpResponseMessage SignupWithEmail(SETB_CMS_Member newUser) |
|||
{ |
|||
string sMsg = null; |
|||
SuccessResponseMessage srm = SugarBase.ExecTran(db => |
|||
{ |
|||
do |
|||
{ |
|||
string sAccount = newUser.Account; |
|||
string sPassword = newUser.Password; |
|||
string sEmail = newUser.Email; |
|||
string sMemberID = Guid.NewGuid().ToString(); //會員編號為GUID
|
|||
string sOrgID = "TG"; //公司編號預設為TG
|
|||
string sStatus = "0"; //會員狀態為未驗證(F)
|
|||
|
|||
string sError = ""; //寄信若有錯誤回傳之訊息
|
|||
|
|||
string sEncryptPwd = SecurityUtil.Encrypt(sPassword); //密碼加密
|
|||
newUser.MemberID = sMemberID; |
|||
newUser.OrgID = sOrgID; |
|||
newUser.Status = sStatus; |
|||
newUser.Password = sEncryptPwd; |
|||
|
|||
//開始寄信
|
|||
var oEmail = new Emails(); //寄件人
|
|||
var toEmail = new List<EmailTo>(); //收件人
|
|||
var oEmailTo = new EmailTo //收件人資訊
|
|||
{ |
|||
ToUserID = newUser.MemberID, |
|||
ToUserName = newUser.LastName, |
|||
ToEmail = newUser.Email, |
|||
Type = "to" |
|||
}; |
|||
toEmail.Add(oEmailTo); |
|||
oEmail.FromUserName = "【ShowEasy 會員認證】"; //取fonfig
|
|||
oEmail.Title = "感謝您註冊ShowEasy"; //取fonfig
|
|||
oEmail.EmailBody = createEmail(newUser.OrgID, newUser.MemberID, newUser.FirstName); |
|||
oEmail.IsCCSelf = false; |
|||
oEmail.Attachments = null; |
|||
oEmail.EmailTo = toEmail; |
|||
var bSend = new MailService(sOrgID, true).MailFactory(oEmail, out sError); |
|||
|
|||
var iRel = db.Insertable(newUser).ExecuteCommand(); |
|||
|
|||
srm = new SuccessResponseMessage(null, null); |
|||
srm.DATA.Add(BLWording.REL, iRel); |
|||
} while (false); |
|||
|
|||
return srm; |
|||
|
|||
}); |
|||
|
|||
return HttpResponseExtension.ToJson(JsonConvert.SerializeObject(srm)); |
|||
} |
|||
|
|||
//重新寄送認證信
|
|||
public HttpResponseMessage ReSendVerifyMail(string OrgID, string MemberID) |
|||
{ |
|||
string sMsg = null; |
|||
SuccessResponseMessage srm = SugarBase.ExecTran(db => |
|||
{ |
|||
do |
|||
{ |
|||
var Mailto = db.Queryable<SETB_CMS_Member>().Single(x => x.OrgID == OrgID && x.MemberID == MemberID); |
|||
string sEmail = Mailto.Email; |
|||
string sOrgID = Mailto.OrgID; |
|||
string sError = ""; |
|||
|
|||
var oEmail = new Emails(); //寄件人
|
|||
var toEmail = new List<EmailTo>(); //收件人
|
|||
var oEmailTo = new EmailTo //收件人資訊
|
|||
{ |
|||
ToUserID = Mailto.MemberID, |
|||
ToUserName = Mailto.LastName, |
|||
ToEmail = Mailto.Email, |
|||
Type = "to" |
|||
}; |
|||
toEmail.Add(oEmailTo); |
|||
oEmail.FromUserName = "【ShowEasy 會員認證】"; //取fonfig
|
|||
oEmail.Title = "感謝您註冊ShowEasy"; //取fonfig
|
|||
oEmail.EmailBody = createEmail(OrgID, MemberID, Mailto.FirstName); |
|||
oEmail.IsCCSelf = false; |
|||
oEmail.Attachments = null; |
|||
oEmail.EmailTo = toEmail; |
|||
var bSend = new MailService(sOrgID, true).MailFactory(oEmail, out sError); |
|||
//if (sError != null)
|
|||
//{
|
|||
// break;
|
|||
//}
|
|||
|
|||
srm = new SuccessResponseMessage(null, null); |
|||
srm.DATA.Add(BLWording.REL, sError); |
|||
} while (false); |
|||
|
|||
return srm; |
|||
|
|||
}); |
|||
|
|||
return HttpResponseExtension.ToJson(JsonConvert.SerializeObject(srm)); |
|||
} |
|||
|
|||
|
|||
//會員認證
|
|||
public HttpResponseMessage VerifyAccount(string OrgID, string MemberID) |
|||
{ |
|||
string sMsg = null; |
|||
|
|||
SuccessResponseMessage srm = SugarBase.ExecTran(db => |
|||
{ |
|||
do |
|||
{ |
|||
var oUser = db.Queryable<SETB_CMS_Member>().Single(x => x.OrgID == OrgID && x.MemberID == MemberID); |
|||
oUser.Status = "1"; //註冊成功
|
|||
var iRel = db.Updateable(oUser).ExecuteCommand(); |
|||
//注冊成功后默認登錄
|
|||
var ticket = new OTB_SYS_TicketAuth |
|||
{ |
|||
OrgID = oUser.OrgID, |
|||
UserID = oUser.Account, |
|||
UserName = oUser.FirstName, |
|||
Token = SignExtension.CreateToken(), |
|||
// LoginIp = i_crm.ClientIP,
|
|||
LoginTime = DateTime.Now |
|||
}; |
|||
var iExpireTime = 240; |
|||
var sExpireTime = Common.GetSystemSetting(db, oUser.OrgID, @"ExpireTime"); |
|||
if (!string.IsNullOrEmpty(sExpireTime)) |
|||
{ |
|||
iExpireTime = int.Parse(sExpireTime); |
|||
} |
|||
else |
|||
{ |
|||
iExpireTime = int.Parse(Common.GetAppSettings(@"ExpireTime")); |
|||
} |
|||
ticket.ExpireTime = DateTime.Now.AddMinutes(iExpireTime); //30分钟过期
|
|||
ticket.IsVerify = @"Y"; |
|||
var oTicket = db.Queryable<OTB_SYS_TicketAuth>().Single(x => x.OrgID == OrgID && x.UserID == oUser.Account); |
|||
if (oTicket != null) |
|||
{ |
|||
db.Updateable(ticket).IgnoreColumns(x => x.OutlookId).Where(x => x.NO == oTicket.NO).ExecuteCommand(); |
|||
} |
|||
else |
|||
{ |
|||
ticket.CreateTime = DateTime.Now; |
|||
db.Insertable(ticket).ExecuteCommand(); |
|||
} |
|||
//記錄log日誌
|
|||
db.Insertable(new OTB_SYS_LoginLog |
|||
{ |
|||
OrgId = ticket.OrgID, |
|||
UserId = ticket.UserID, |
|||
UserName = ticket.UserName, |
|||
LoginIp = ticket.LoginIp, |
|||
LoginTime = ticket.LoginTime |
|||
}).ExecuteCommand(); |
|||
HttpRuntimeCache.Set(ticket.OrgID + ticket.UserID, ticket, iExpireTime * 60, true); |
|||
HttpContext.Current.Session.Add(@"orgid", ticket.OrgID); |
|||
HttpContext.Current.Session.Add(@"userid", ticket.UserID); |
|||
HttpCookie cookie = new HttpCookie("EURO_COOKIE"); //初始化並設置Cookie的名稱
|
|||
DateTime dt = DateTime.Now; |
|||
TimeSpan ts = new TimeSpan(0, 0, 1, 0, 0); //過期時間為1分鐘
|
|||
cookie.Expires = dt.Add(ts); //設置過期時間
|
|||
cookie.Values.Add("orgid", ticket.OrgID); |
|||
cookie.Values.Add("userid", ticket.UserID); |
|||
HttpContext.Current.Response.AppendCookie(cookie); |
|||
|
|||
var strtoken = string.Format(@"orgid:{0},userid:{1},token:{2}", ticket.OrgID, ticket.UserID, ticket.Token); |
|||
srm = new SuccessResponseMessage(null, null); |
|||
srm.DATA.Add("authtoken", SecurityUtil.Encrypt(strtoken)); |
|||
|
|||
} while (false); |
|||
|
|||
return srm; |
|||
}); |
|||
|
|||
return HttpResponseExtension.ToJson(JsonConvert.SerializeObject(srm)); |
|||
} |
|||
|
|||
//Mail Template
|
|||
private string createEmail(string OrgID, string MemberID, string FirstName) |
|||
{ |
|||
|
|||
StringBuilder sb = new StringBuilder(); |
|||
|
|||
sb.Append("<!DOCTYPE html>"); |
|||
sb.Append("<html lang=\"en\" xmlns = \"http://www.w3.org/1999/xhtml\" xmlns: o = \"urn:schemas-microsoft-com:office:office\" xmlns: v = \"urn:schemas-microsoft-com:vml\"> "); |
|||
|
|||
//Head
|
|||
sb.Append("<head>"); |
|||
sb.Append("<meta charset=\"utf-8\" />"); |
|||
sb.Append("<meta name=\"viewport\" content=\"width = device-width\" />"); |
|||
sb.Append("<meta http-equiv=\"X-UA-Compatible\" content=\"IE = edge\" />"); |
|||
sb.Append("<meta name=\"x-apple-disable-message-reformatting\" />"); |
|||
sb.Append("<meta name = \"format-detection\" content = \"telephone=no,address=no,email=no,date=no,url=no\" /> "); |
|||
|
|||
//CSS Reset Style
|
|||
sb.Append("<style>"); |
|||
sb.Append("html,body {margin: 0 auto !important;padding: 0 !important;height: 100% !important;width: 100% !important;}"); |
|||
//Stops email clients resizing small text
|
|||
sb.Append("* {-ms-text-size-adjust: 100 %;-webkit-text-size-adjust: 100%;}"); |
|||
//Centers email on Android 4.4
|
|||
sb.Append("div[style*=\"margin: 16px 0\"] {margin: 0!important;}"); |
|||
//Stops Outlook from adding extra spacing to tables
|
|||
sb.Append("table,td {mso-table-lspace: 0pt !important;mso-table-rspace: 0pt !important;}"); |
|||
sb.Append("table {border: 0;border-spacing: 0;border-collapse: collapse;}"); |
|||
//Forces Samsung Android mail clients to use the entire viewport.
|
|||
sb.Append("#MessageViewBody,#MessageWebViewDiv {width: 100% !important;}"); |
|||
sb.Append("img {-ms-interpolation-mode: bicubic;}"); |
|||
//Prevents Windows 10 Mail from underlining links despite inline CSS. Styles for underlined links should be inline.
|
|||
sb.Append("a {text-decoration: none;}"); |
|||
//A work-around for email clients automatically linking certain text strings.
|
|||
sb.Append("a[x-apple-data-detectors],.unstyle-auto-detected-links a,.aBn {border - bottom: 0 !important;cursor: default !important;color: inherit !important;text-decoration: none !important;font - size: inherit !important;font-family: inherit !important;font-weight: inherit !important;line-height: inherit !important;}"); |
|||
//Gmail、Samsung Mail
|
|||
sb.Append("u + #body a,#MessageViewBody a{color: inherit;text-decoration: none;font-size: inherit;font-family: inherit;font-weight: inherit;line-height: inherit;}"); |
|||
//Prevents Gmail from changing the text color in conversation threads.
|
|||
sb.Append(".im {color: inherit !important;}"); |
|||
//Prevents Gmail from displaying an download button on large, non-linked images
|
|||
sb.Append(".a6S {display: none !important;opacity: 0.01 !important;}"); |
|||
//If the above doesn't work, add a .g-img class to any image in question.
|
|||
sb.Append("img.g-img + div {display: none !important;}"); |
|||
//RWD
|
|||
//Removes right gutter in Gmail iOS app: https://github.com/TedGoas/Cerberus/issues/89
|
|||
//Create one of these media queries for each additional viewport size you'd like to fix
|
|||
sb.Append("@media only screen and (min-device-width: 320px) and (max-device-width: 374px) {u ~ div.email-container {min-width: 320px !important;}}"); |
|||
sb.Append("@media only screen and (min-device-width: 375px) and (max-device-width: 413px) {u ~ div.email-container {min-width: 375px !important;}}"); |
|||
sb.Append("@media only screen and (min-device-width: 414px) {u ~ div.email-container {min-width: 414px !important;}"); |
|||
sb.Append("</style>"); |
|||
|
|||
//CSS Style
|
|||
//Hover styles for buttons and tags
|
|||
sb.Append("<style>"); |
|||
sb.Append(".s-btn__primary:hover {backgbackground: #eff0f1 !important;border-color: #eff0f1 !important;}"); |
|||
sb.Append(".s-btn__outlined:hover {background: rgba(0, 119, 204, 0.05) !important;color: #faae69 !important;}"); |
|||
sb.Append(".s-tag:hover,.post-tag:hover {border-color: #cee0ed !important;}"); |
|||
//Styles markdown links that we can't write inline CSS for
|
|||
sb.Append(".has-markdown a,.has-markdown a: visited {color: #0077cc !important;text-decoration: none!important;}"); |
|||
//Styles markdown code blocks that we can't write inline CSS for
|
|||
sb.Append("code {padding: 1px 5px;background-color: #eff0f1;color: #242729;font-size: 13px;line-height: inherit;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono,DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace,sans-serif;}"); |
|||
sb.Append("pre {margin: 0 0 15px;line-height: 17px;background-color: #eff0f1;padding: 4px 8px;border-radius: 3px;overflow-x: auto;}"); |
|||
sb.Append("pre code {margin: 0 0 15px;padding: 0;line-height: 17px;background-color: none;}"); |
|||
//Styles markdown blockquotes that we can't write inline CSS for
|
|||
sb.Append("blockquote {margin: 0 0 15px;padding: 4px 10px;background-color: #fff8dc;border-left: 2px solid #ffeb8e;}"); |
|||
sb.Append("blockquote p {padding: 4px 0;margin: 0;overflow-wrap: break-word;}"); |
|||
//Rounds corners in email clients that support it
|
|||
sb.Append(".bar {border-radius: 16px;}"); |
|||
sb.Append(".btr {border-top-left-radius: 16px;border-top-right-radius: 16px;}"); |
|||
sb.Append(".bbr {border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;}"); |
|||
sb.Append("@media screen and (max-width: 500px) {"); |
|||
//Forces table cells into full-width rows
|
|||
sb.Append(".stack-column,.stack-column-center {display: block!important;width: 100 % !important;max-width: 100 % !important;direction: ltr!important;}"); |
|||
//And center justify these ones
|
|||
sb.Append(".stack-column-center {text-align: center !important;}"); |
|||
//Hides things in small viewports
|
|||
sb.Append(".hide-on-mobile {display: none!important;max-height: 0 !important;overflow: hidden !important;visibility: hidden !important;}"); |
|||
//Utility classes to reduce spacing for smaller viewports
|
|||
sb.Append(".sm-p-none {padding: 0!important;}"); |
|||
sb.Append(".sm-pt-none {padding-top: 0!important;}"); |
|||
sb.Append(".sm-pb-none {padding-bottom: 0!important;}"); |
|||
sb.Append(".sm-pr-none {padding-right: 0!important;}"); |
|||
sb.Append(".sm-pl-none {padding-left: 0!important;}"); |
|||
sb.Append(".sm-px-none {padding-left: 0!important;padding-right: 0!important;}"); |
|||
sb.Append(".sm-py-none {padding-top: 0 !important;padding-bottom: 0!important;}"); |
|||
sb.Append(".sm-pr {padding-right: 50px !important;}"); |
|||
sb.Append(".sm-pl {padding-left: 50px !important;}"); |
|||
sb.Append(".sm-px {padding-left: 50px !important;padding-right: 50px!important;}"); |
|||
sb.Append(".sm-py {padding-top: 50px !important;padding-bottom: 50px!important;}"); |
|||
sb.Append("*/ .sm-mb {margin-bottom: 50px !important;}"); |
|||
//Utility classes to kill border radius for smaller viewports. Used mainly on the email's main container(s)
|
|||
sb.Append(".bar,.btr,.bbr {border-top-left-radius: 0;border-top-right-radius: 0;border-bottom-left-radius: 0;border-bottom-right-radius: 0;}"); |
|||
sb.Append("}"); |
|||
sb.Append("</style>"); |
|||
sb.Append("</head>"); |
|||
|
|||
//BODY
|
|||
//The email background color is defined in three places, just below. If you change one, remember to change the others.
|
|||
//1. body tag: for most email clients
|
|||
//2. center tag: for Gmail and Inbox mobile apps and web versions of Gmail, GSuite, Inbox, Yahoo, AOL, Libero, Comcast, freenet, Mail.ru, Orange.fr
|
|||
//3. mso conditional: For Windows 10 Mail
|
|||
sb.Append("<body width = \"100%\" style = \"margin: 0;padding: 0!important;background: #f8f8f8;mso-line-height-rule: exactly;\"> "); |
|||
sb.Append("<center style=\"width: 100 %; background: #f8f8f8\">"); |
|||
sb.Append("<div class=\"email-container\" style=\"max-width: 500px; margin: 0 auto\">"); |
|||
sb.Append("<table border = \"0\" bgcolor = \"#F8F8F8\" cellpadding = \"0\" cellspacing = \"0\" role = \"presentation\" style = \"max-width: 500px; width: 100%\"> "); |
|||
//ShowEasy Logo
|
|||
sb.Append("<tr>"); |
|||
sb.Append("<td style = \"padding-top: 40px;padding-right:0px;padding-bottom:30px;padding-left:60px; text-align: left\" class=\"sm-px\">"); |
|||
sb.Append("<a href=\"https://www.showeasy.com/ \">"); |
|||
sb.Append("<img src = \"https://d3kpqi6h465b7i.cloudfront.net/email/logo.png \" width = \"133\" height = \"18\" style = \"display: block\"/> "); |
|||
sb.Append("</a>"); |
|||
sb.Append("</td>"); |
|||
sb.Append("</tr>"); |
|||
//Email Body
|
|||
sb.Append("<tr>"); |
|||
sb.Append("<td style = \"padding: 0 50px 0 50px; background-color: #f8f8f8\" class=\"sm-p bar\">"); |
|||
sb.Append("<table border=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"width: 100%\">"); |
|||
sb.Append("<tr>"); |
|||
sb.Append("<td>"); |
|||
sb.Append("<table border = \"0\" cellpadding = \"0\" cellspacing = \"0\" role = \"presentation\" align = \"left\"> "); |
|||
sb.Append("<tr>"); |
|||
sb.Append("<td bgcolor = \"#FEFEFE\" width = \"340\" style = \"display: block; padding-top: 30px; padding-left: 30px; padding-right: 30px; font-family: arial, sans-serif; color: #000000; text-align: left;\"> "); |
|||
sb.Append("<img style = \"display: block\" src = \"https://d3kpqi6h465b7i.cloudfront.net/email/verifyAccount.png \" width = \"40\" height = \"40\"/> "); |
|||
sb.Append("</td>"); |
|||
sb.Append("</tr>"); |
|||
//Text:VerifyYourAccount
|
|||
sb.Append("<tr>"); |
|||
sb.Append("<td bgcolor = \"#FEFEFE\" width = \"340\" style = \"display: block;padding-top: 30px;padding-left: 30px;padding-right: 30px;font-family: arial, sans-serif;color: #000000;text-align: left\";>"); |
|||
sb.Append("<h1 style = \"font-family: 'arial', 'sans-serif'; font-weight: 700; font-size: 16px; line-height: 18px; color: #000000; margin: 0 0 0 0;\">"); |
|||
sb.Append("VERIFY YOUR ACCOUNT"); |
|||
sb.Append("</h1>"); |
|||
sb.Append("</td>"); |
|||
sb.Append("</tr>"); |
|||
//Text:Hi,xxx
|
|||
sb.Append("<tr>"); |
|||
sb.Append("<td bgcolor = \"#FEFEFE\" width = \"340\" style = \"display: block;padding-top: 30px;padding-left: 30px;padding-right: 30px;font-family: arial, sans-serif;color: #000000;text-align: left;\">"); |
|||
sb.Append("<h1 style = \"font-family: 'arial', 'sans-serif';font-weight: 700;font-size: 16px;line-height: 18px;color: #000000;margin: 0 0 0 0;\">"); |
|||
sb.Append("Hi " + FirstName + ","); |
|||
sb.Append("</h1>"); |
|||
sb.Append("</td>"); |
|||
sb.Append("</tr>"); |
|||
//Text:Welcome to....
|
|||
sb.Append("<tr>"); |
|||
sb.Append("<td bgcolor = \"#FEFEFE\" width = \"340\" width = \"340px\" style = \"display: block;padding-top: 10px;padding-left: 30px;padding-right: 30px;color: #9c9c9c;text-align: left;\">"); |
|||
sb.Append("<p style = \"font-weight: 400;font-size: 12px;line-height: 14px;letter-spacing: 0.02em;font-family: 'arial', 'sans-serif';margin: 0 0 0px;\" class=\"has-markdown\">"); |
|||
sb.Append("Welcome to ShowEasy!<br />"); |
|||
sb.Append("Thanks for joining us, please click <span style=\"color: #f48800;\">Verify my account</span> to</br>"); |
|||
sb.Append("complete and activate your account. The link will be expired</br>"); |
|||
sb.Append("in 30 minutes."); |
|||
sb.Append("</p>"); |
|||
sb.Append("</td>"); |
|||
sb.Append("</tr>"); |
|||
sb.Append("</tr>"); |
|||
//Button:Verify my account
|
|||
sb.Append("<tr>"); |
|||
sb.Append("<td bgcolor = \"#FEFEFE\" style = \"display: block;padding-top: 30px;font-family: arial, sans-serif;color: #232323;text-align: left;\"> "); |
|||
sb.Append("<table align = \"center\" border = \"0\" cellspacing = \"0\" role = \"presentation\">"); |
|||
sb.Append("<tr>"); |
|||
sb.Append("<td class=\"s-btn s-btn__primary\" style=\"border-radius: 16px; background: #ee9546\">"); |
|||
sb.Append("<a class=\"s-btn s-btn__primary\" href=\""); |
|||
sb.Append("http://" + SERVER_IP + ":" + SERVER_PORT + "/api/Signup/VerifyAccount?OrgID=" + OrgID + "&MemberID=" + MemberID); |
|||
sb.Append(" \" target=\"_parent\" style=\"background: #ee9546;border: 1px solid #ee9546;font-family: arial, sans-serif; font-size: 14px;line-height: 16px; color: #ffffff;text-align: center;text-decoration: none;padding: 12px 20px; display: block; border-radius: 16px; white-space: nowrap;\">"); |
|||
sb.Append("Verify my account"); |
|||
sb.Append("</a>"); |
|||
sb.Append("</td>"); |
|||
sb.Append("</tr>"); |
|||
sb.Append("</table>"); |
|||
sb.Append("</td>"); |
|||
sb.Append("</tr>"); |
|||
|
|||
//Email Buttom
|
|||
//Text:If the button isn't working....
|
|||
sb.Append("<tr>"); |
|||
sb.Append("<td bgcolor = \"#FEFEFE\" width = \"340\" width = \"340px\" style = \"display: block;padding-top: 30px;padding-left: 30px;padding-right: 30px;color: #9c9c9c;text-align: center;\">"); |
|||
sb.Append("<p style = \"font-weight: 400;font-size: 12px;line-height: 14px;letter-spacing: 0.02em;font-family: 'arial', 'sans-serif';margin: 0 0 0px;\" class=\"has-markdown\">"); |
|||
sb.Append("If the button isn't working, you can click the link below:"); |
|||
sb.Append("</p>"); |
|||
sb.Append("</td>"); |
|||
sb.Append("</tr>"); |
|||
//Link
|
|||
sb.Append("<tr>"); |
|||
sb.Append("<td align = \"center\" width = \"340\" bgcolor = \"#FEFEFE\" style = \"display: block;padding-bottom: 30px;padding-top: 0px;padding-left: 30px;padding-right: 30px;color: #9c9c9c;text-align: center;border-bottom-left-radius: 16px;border-bottom-right-radius: 16px;\">"); |
|||
sb.Append("<a href = \"https://www.showeasy.com/aboutUs \" style = \"color: #7997ff;font-size: 12px;font-weight: 400;font-family: 'Arial', '微軟正黑體','Microsoft JhengHei', 'Helvetica Neue',Helvetica, Arial, sans-serif;padding: 0;margin: 0;text-align: center;padding-left: 0px;padding-right: 30px;padding-top: 4px;text-decoration: underline;\">"); |
|||
sb.Append("<span align=\"center\" width=\"340\">https://www.showeasy.com/aboutUs</span>"); |
|||
sb.Append("</a>"); |
|||
sb.Append("</td>"); |
|||
sb.Append("</tr>"); |
|||
sb.Append("</table>"); |
|||
sb.Append("</td>"); |
|||
sb.Append("</tr>"); |
|||
sb.Append("</table>"); |
|||
sb.Append("</td>"); |
|||
sb.Append("</tr>"); |
|||
|
|||
//Footer
|
|||
//Text:Follow us
|
|||
sb.Append("<tr>"); |
|||
sb.Append("<td style=\"padding-top: 20px; padding-bottom: 20px\" class=\"sm-p\">"); |
|||
sb.Append("<table align = \"left\" border = \"0\" cellpadding = \"0\" cellspacing = \"0\" role = \"presentation\" width = \"100%\">"); |
|||
sb.Append("<tr>"); |
|||
sb.Append("<td style=\"display: block; color: #232323; text-align: left\">"); |
|||
sb.Append("<h1 style =\"text-align: center;font-family: 'Arial', 'sans-serif';font-weight: 700;font-size: 14px;line-height: 18px;color: #232323;margin: 0 0 0 0;\">"); |
|||
sb.Append("FOLLOW US"); |
|||
sb.Append("</h1>"); |
|||
sb.Append("</td>"); |
|||
sb.Append("</tr>"); |
|||
//FB、IG、Medium Icon
|
|||
sb.Append("<tr>"); |
|||
sb.Append("<td align=\"center\" style=\"padding-top: 10px\">"); |
|||
sb.Append("<table>"); |
|||
sb.Append("<tr align=\"center\">"); |
|||
sb.Append("<td>"); |
|||
sb.Append("<img style = \"display: block\" src = \"https://d3kpqi6h465b7i.cloudfront.net/email/icon-facebook.png \" width = \"30\" height = \"30\"/>"); |
|||
sb.Append("</td>"); |
|||
sb.Append("<td style=\"padding-left: 20px; padding-right: 20px\">"); |
|||
sb.Append("<img style =\"display: block\" src = \"https://d3kpqi6h465b7i.cloudfront.net/email/icon-instagram.png \" width = \"30\" height = \"30\"/>"); |
|||
sb.Append("</td>"); |
|||
sb.Append("<td>"); |
|||
sb.Append("<img style = \"display: block\" src = \"https://d3kpqi6h465b7i.cloudfront.net/email/icon-medium.png \" width = \"30\" height = \"30\"/>"); |
|||
sb.Append("</td>"); |
|||
sb.Append("</tr>"); |
|||
sb.Append("</table>"); |
|||
sb.Append("</td>"); |
|||
sb.Append("</tr>"); |
|||
//Text:2022 Showeasy. All rights reserved.
|
|||
sb.Append("<tr>"); |
|||
sb.Append("<td style=\"padding-top: 30px\">"); |
|||
sb.Append("<h1 align = \"center\" style =\"color: #bababa;font-size: 10px;font-weight: 400;font-family: 'Arial', 'sans-serif';padding: 0;margin: 0;line-height: 14px;\">"); |
|||
sb.Append("© 2022 Showeasy. All rights reserved."); |
|||
sb.Append("</h1>"); |
|||
sb.Append("</td>"); |
|||
sb.Append("</tr>"); |
|||
//Text:www.showeasy.com
|
|||
sb.Append("<tr>"); |
|||
sb.Append("<td>"); |
|||
sb.Append("<h1 align = \"center\" style = \"font-weight: 400;color: #232323;line-height: 22px;font-size: 10px;font-weight: 400;font-family: 'Arial', 'sans-serif';padding: 0;margin: 0;\">"); |
|||
sb.Append("www.showeasy.com"); |
|||
sb.Append("</h1>"); |
|||
sb.Append("</td>"); |
|||
sb.Append("</tr>"); |
|||
sb.Append("</table>"); |
|||
sb.Append("</td>"); |
|||
sb.Append("</tr>"); |
|||
sb.Append("</table>"); |
|||
sb.Append("</div>"); |
|||
sb.Append("</center>"); |
|||
sb.Append("</body>"); |
|||
sb.Append("</html>"); |
|||
|
|||
return sb.ToString(); |
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
} |
@ -0,0 +1,47 @@ |
|||
using EasyBL.WebApi.Filters; |
|||
using EasyBL.WEBAPP.ShowEasy; |
|||
using EasyBL.WEBAPP.SYS; |
|||
using Entity.ShowEasyDtos; |
|||
using Entity.Sugar; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Net; |
|||
using System.Net.Http; |
|||
using System.Web.Http; |
|||
|
|||
namespace WebApp.Controllers |
|||
{ |
|||
public class SignupController : ApiController |
|||
{ |
|||
|
|||
//使用者以信箱註冊
|
|||
[HttpPost] |
|||
public HttpResponseMessage SignupWithEmail([FromBody] SETB_CMS_Member dto) |
|||
{ |
|||
|
|||
return new SignupService().SignupWithEmail(dto); |
|||
|
|||
} |
|||
|
|||
//重新寄送認證信
|
|||
[HttpGet] |
|||
public HttpResponseMessage ReSendVerifyMail(string OrgID, string MemberID) |
|||
{ |
|||
|
|||
return new SignupService().ReSendVerifyMail(OrgID, MemberID); |
|||
|
|||
} |
|||
|
|||
//會員認證
|
|||
[HttpGet] |
|||
public HttpResponseMessage VerifyAccount(string OrgID, string MemberID) |
|||
{ |
|||
|
|||
return new SignupService().VerifyAccount(OrgID, MemberID); |
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue