{LocalizationHelper.GetLocalizedString( - $"You have successfully registered to the system on {DateTime.Now:yyyy/MM/dd}. Your account credentials are as follows:", - $"您已于{DateTime.Now:yyyy/MM/dd}新注册系统成功,账号密码如下:")} -
-{newPassword}
-{LocalizationHelper.GetLocalizedString( - "Please keep your password secure and change it after login.", - "请妥善保管密码,并在成功登录后修改为你能记住的密码!")}
"; - - mailHelper.SendMail(new List{LocalizationHelper.GetLocalizedString( - $"Your password was reset at {DateTime.Now:yyyy/MM/dd}. New password:", - $"系统已于{DateTime.Now:yyyy/MM/dd}为你重置密码成功,新密码如下:")} -
-{newPwd}
-{LocalizationHelper.GetLocalizedString( - "Please keep your password secure and change it after login.", - "请妥善保管密码,并在成功登录后修改为你能记住的密码!")}
"; - - mailHelper.SendMail(new List{LocalizationHelper.GetLocalizedString( + $"Your password was reset at {DateTime.Now:yyyy/MM/dd HH:mm}. New password:", + $"您的密码已在{DateTime.Now:yyyy/MM/dd HH:mm}重置。新密码如下:")} +
+{newPwd}
+{LocalizationHelper.GetLocalizedString( + "Please keep your password secure and change it after login.", + "请妥善保管密码,并在成功登录后修改为你能记住的密码!")}
" + }; + } + + public static Template GetNewRegistrationTemplate(string newPassword) + { + return new Template + { + Subject = LocalizationHelper.GetLocalizedString("New Registration Notification", "新注册通知"), + Body = $@"{LocalizationHelper.GetLocalizedString( + $"You have successfully registered to the system on {DateTime.Now:yyyy/MM/dd}. Your account credentials are as follows:", + $"您已于{DateTime.Now:yyyy/MM/dd}新注册系统成功,账号密码如下:")} +
+{newPassword}
+{LocalizationHelper.GetLocalizedString( + "Please keep your password secure and change it after login.", + "请妥善保管密码,并在成功登录后修改为你能记住的密码!")}
" + }; + } + + public static Template GetUpdatePasswordTemplate(string newPassword) + { + return new Template + { + Subject = LocalizationHelper.GetLocalizedString("Update Password Notification", "更新密码通知"), + Body = $@"{LocalizationHelper.GetLocalizedString( + $"Your password was updated at {DateTime.Now:yyyy/MM/dd}. New password:", + $"您的密码已在{DateTime.Now:yyyy/MM/dd}更新。新密码如下:")} +
+{newPassword}
+{LocalizationHelper.GetLocalizedString( + "Please keep your password secure and change it after login.", + "请妥善保管密码!")}
" + }; + } + } +} diff --git a/EOM.TSHotelManagement.Shared/JwtConfig.cs b/EOM.TSHotelManagement.Shared/Config/JwtConfig.cs similarity index 100% rename from EOM.TSHotelManagement.Shared/JwtConfig.cs rename to EOM.TSHotelManagement.Shared/Config/JwtConfig.cs diff --git a/EOM.TSHotelManagement.Shared/Interfaces/LskyConfig.cs b/EOM.TSHotelManagement.Shared/Config/LskyConfig.cs similarity index 100% rename from EOM.TSHotelManagement.Shared/Interfaces/LskyConfig.cs rename to EOM.TSHotelManagement.Shared/Config/LskyConfig.cs diff --git a/EOM.TSHotelManagement.Shared/MailConfig.cs b/EOM.TSHotelManagement.Shared/Config/MailConfig.cs similarity index 94% rename from EOM.TSHotelManagement.Shared/MailConfig.cs rename to EOM.TSHotelManagement.Shared/Config/MailConfig.cs index 290e38c05f8fc99fa8f20fdd14c984241ac27c35..aa60aee24b52b1539866802bf3367a822aa7c7dc 100644 --- a/EOM.TSHotelManagement.Shared/MailConfig.cs +++ b/EOM.TSHotelManagement.Shared/Config/MailConfig.cs @@ -1,4 +1,4 @@ -namespace EOM.TSHotelManagement.Shared +namespace EOM.TSHotelManagement { public class MailConfig { diff --git a/EOM.TSHotelManagement.Shared/Config/Template.cs b/EOM.TSHotelManagement.Shared/Config/Template.cs new file mode 100644 index 0000000000000000000000000000000000000000..e49907dc4158d93ce999e9922b10e151f4ace44e --- /dev/null +++ b/EOM.TSHotelManagement.Shared/Config/Template.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Shared +{ + public class Template + { + public string Subject { get; set; } + public string Body { get; set; } + } +} diff --git a/EOM.TSHotelManagement.Shared/EnumHelper.cs b/EOM.TSHotelManagement.Shared/EnumHelper.cs index 453693cb9e7d4dd8998c7da154f2ffe372f697f4..b5828a45bd014b762ce2505049a1ce2ade542aec 100644 --- a/EOM.TSHotelManagement.Shared/EnumHelper.cs +++ b/EOM.TSHotelManagement.Shared/EnumHelper.cs @@ -29,5 +29,24 @@ namespace EOM.TSHotelManagement.Shared throw new ArgumentNullException(nameof(value)); return Convert.ToInt32(value); } + + public string GetDescriptionByName