API
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

MailRepository.cs 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. using Abp.Specifications;
  2. using MimeKit;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Linq.Dynamic.Core;
  7. using System.Net.Mail;
  8. using System.Text;
  9. using UnivateProperties_API.Containers.Timeshare;
  10. using UnivateProperties_API.Context;
  11. using UnivateProperties_API.Helpers;
  12. using UnivateProperties_API.Model.Communication;
  13. using UnivateProperties_API.Model.ProcessFlow;
  14. using UnivateProperties_API.Model.Timeshare;
  15. using UnivateProperties_API.Model.Users;
  16. namespace UnivateProperties_API.Repository.Communication
  17. {
  18. public interface IMailRepository
  19. {
  20. void ContactUs(MailModel mm);
  21. void EnquireNow(MailModel mm);
  22. void AddRecipient(MailRecipient rec);
  23. List<MailRecipient> GetMailRecipients();
  24. MailRecipient GetMailRecipientById(int id);
  25. void UpdateMailRecipient(MailRecipient rec);
  26. void DeleteMailRecipient(int id);
  27. List<MailModel> GetEnquireNowLog();
  28. List<MailModel> GetContactUsLog();
  29. }
  30. public class MailRepository : IMailRepository
  31. {
  32. private readonly DataContext _dbContext;
  33. public MailRepository(DataContext db)
  34. {
  35. _dbContext = db;
  36. }
  37. public MailRepository()
  38. {
  39. }
  40. public void ContactUs(MailModel mm)
  41. {
  42. var recipients = _dbContext.MailRecipients.Where(x => x.RecipientUsage == "ContactUs").Where(y => y.IsDeleted == false).ToList();
  43. string body = _dbContext.Templates.Where(x => x.Name == "ContactUs").Where(y => y.IsDeleted == false).FirstOrDefault().Body;
  44. string error = "";
  45. body = body.Replace("[FULLNAME]", mm.Name);
  46. body = body.Replace("[USEREMAIL]", mm.Email);
  47. body = body.Replace("[USERCELLPHONE]", mm.Phone);
  48. body = body.Replace("[PROPERTYREF]", mm.Property);
  49. body = body.Replace("[USERMESSAGE]", mm.Message);
  50. string toList = "";
  51. int emailCount = 0;
  52. foreach (var recipient in recipients)
  53. {
  54. toList += recipient.RecipientMail + ", ";
  55. emailCount++;
  56. }
  57. if (toList.Length > 0)
  58. {
  59. if (emailCount == 1)
  60. toList = toList.Substring(0, toList.Length - 2);
  61. else
  62. toList = toList.Substring(0, toList.Length - 2);
  63. }
  64. try
  65. {
  66. var host = _dbContext.Hosts.FirstOrDefault();
  67. using (SmtpClient smtp = new SmtpClient(host.Host))
  68. {
  69. MailMessage mail = new MailMessage();
  70. mail.To.Add(toList);
  71. mail.Subject = "Uni-Vate - New Contact Request";
  72. mail.Body = body;
  73. mail.IsBodyHtml = true;
  74. mail.BodyEncoding = Encoding.ASCII;
  75. mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
  76. mail.Sender = new MailAddress(host.User, "UniVate Properties");
  77. mail.From = new MailAddress(mm.Email, mm.Name);
  78. smtp.UseDefaultCredentials = host.NeedsAuthorize;
  79. smtp.Credentials = host.GetNetworkCredential();
  80. smtp.EnableSsl = host.UseSSL;
  81. smtp.Send(mail);
  82. }
  83. error = "None";
  84. }
  85. catch (Exception ex)
  86. {
  87. error = ex.ToString();
  88. }
  89. mm.ComType = "Contact Us";
  90. mm.Error = error;
  91. _dbContext.CommunicationLog.Add(mm);
  92. _dbContext.SaveChanges();
  93. }
  94. public void EnquireNow(MailModel mm)
  95. {
  96. var recipients = _dbContext.MailRecipients.Where(x => x.RecipientUsage == "EnquireNow").Where(y => y.IsDeleted == false).ToList();
  97. string body = _dbContext.Templates.Where(x => x.Name == "EnquireNow").Where(y => y.IsDeleted == false).FirstOrDefault().Body;
  98. var property = _dbContext.Properties.Where(x => x.Id == Convert.ToInt32(mm.Property)).FirstOrDefault();
  99. string error = "";
  100. body = body.Replace("[FULLNAME]", " " + mm.Name);
  101. body = body.Replace("[USEREMAIL]", " " + mm.Email);
  102. body = body.Replace("[USERCELLPHONE]", " " + mm.Phone);
  103. body = body.Replace("[PROPERTYID]", " " + mm.Property);
  104. body = body.Replace("[PROPERTYNAME]", property.PropertyName);
  105. body = body.Replace("[PROPERTYREF]", property.PropertyRef);
  106. body = body.Replace("[PROPERTYPRICE]", property.Price.ToString());
  107. body = body.Replace("[USERMESSAGE]", " " + mm.Message);
  108. body = body.Replace("[USERHEARDFROM]", " " + mm.HeardFrom);
  109. string toList = "";
  110. int emailCount = 0;
  111. foreach (var recipient in recipients)
  112. {
  113. toList += recipient.RecipientMail + ", ";
  114. emailCount++;
  115. }
  116. if (toList.Length > 0)
  117. {
  118. if (emailCount == 1)
  119. toList = toList.Substring(0, toList.Length - 2);
  120. else
  121. toList = toList.Substring(0, toList.Length - 2);
  122. }
  123. try
  124. {
  125. var host = _dbContext.Hosts.FirstOrDefault();
  126. using (SmtpClient smtp = new SmtpClient(host.Host))
  127. {
  128. MailMessage mail = new MailMessage();
  129. mail.To.Add(toList);
  130. mail.Subject = "Uni-Vate - Enquiry to view property";
  131. mail.Body = body;
  132. mail.IsBodyHtml = true;
  133. mail.BodyEncoding = Encoding.ASCII;
  134. mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
  135. mail.Sender = new MailAddress(host.User, "UniVate Properties");
  136. mail.From = new MailAddress(mm.Email, mm.Name);
  137. smtp.UseDefaultCredentials = host.NeedsAuthorize;
  138. smtp.Credentials = host.GetNetworkCredential();
  139. smtp.EnableSsl = host.UseSSL;
  140. smtp.Send(mail);
  141. }
  142. error = "None";
  143. }
  144. catch (Exception ex)
  145. {
  146. error = ex.ToString();
  147. }
  148. mm.ComType = "Enquire Now";
  149. mm.Error = error;
  150. _dbContext.CommunicationLog.Add(mm);
  151. _dbContext.SaveChanges();
  152. }
  153. public void ForgotPassword(Individual toPerson, string link)
  154. {
  155. string body = "<div style=\"margin: 5px\">" +
  156. "<h4>Dear " + toPerson.FullName + "</h4>" +
  157. "<h4>There has been a request to reset your password. If this is incorrect please send an email to info@univateproperties.co.za</h4>" +
  158. "<h4>Once your password has been reset you can use the username "+ toPerson.User.Username + " and the new password to log in.</h4>" +
  159. "<div>" +
  160. "<h4><a href='" + link + "'>Click here</a> to reset your password.</h4>" +
  161. "<br />"+
  162. "<h4>Thank You</h4>" +
  163. "<h4>Team Uni-Vate</h4>" +
  164. "</div>" +
  165. "</div>";
  166. var host = _dbContext.Hosts.FirstOrDefault();
  167. using (SmtpClient smtp = new SmtpClient(host.Host))
  168. {
  169. MailMessage mail = new MailMessage();
  170. mail.To.Add(new MailAddress(toPerson.Email, toPerson.FullName));
  171. mail.Subject = "Uni-Vate - Password Reset Request";
  172. mail.Body = body;
  173. mail.IsBodyHtml = true;
  174. mail.BodyEncoding = Encoding.ASCII;
  175. mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
  176. mail.Sender = new MailAddress(host.User, "UniVate Properties");
  177. mail.From = mail.Sender;
  178. smtp.UseDefaultCredentials = host.NeedsAuthorize;
  179. smtp.Credentials = host.GetNetworkCredential();
  180. smtp.EnableSsl = host.UseSSL;
  181. smtp.Send(mail);
  182. }
  183. }
  184. public void WeekOfferMadeOwner(TimeshareWeek week, BidItem bid)
  185. {
  186. var recipients = _dbContext.MailRecipients.Where(x => x.RecipientUsage == "WeekOfferMade-Owner").Where(y => y.IsDeleted == false).ToList();
  187. string body = _dbContext.Templates.Where(x => x.Name == "WeekOfferMade-Owner").Where(y => y.IsDeleted == false).FirstOrDefault().Body;
  188. body = body.Replace("[OWNER]", week.DisplayOwner);
  189. body = body.Replace("[RESORTNAME]", week.ResortName);
  190. body = body.Replace("[UNITNUMBER]", week.UnitNumber);
  191. body = body.Replace("[MODULE]", week.Module);
  192. body = body.Replace("[OFFERMADE]", bid.Amount.ToString());
  193. body = body.Replace("[FULLNAME]", bid.BidMaker.Display);
  194. body = body.Replace("[USEREMAIL]", bid.BidMaker.Email);
  195. body = body.Replace("[USERCELLPHONE]", bid.BidMaker.CellNumber);
  196. body = body.Replace("[USERTELEPHONE]", bid.BidMaker.Telephone);
  197. body = body.Replace("[USERCOMMENT]", bid.Comment);
  198. string toList = "";
  199. int emailCount = 0;
  200. foreach (var recipient in recipients)
  201. {
  202. toList += recipient.RecipientMail + ", ";
  203. emailCount++;
  204. }
  205. if (toList.Length > 0)
  206. {
  207. if (emailCount == 1)
  208. toList = toList.Substring(0, toList.Length - 2);
  209. else
  210. toList = toList.Substring(0, toList.Length - 2);
  211. }
  212. var host = _dbContext.Hosts.FirstOrDefault();
  213. using (SmtpClient smtp = new SmtpClient(host.Host))
  214. {
  215. MailMessage mail = new MailMessage();
  216. mail.To.Add(toList);
  217. mail.Subject = "Uni-Vate - New Contact Request";
  218. mail.Body = body;
  219. mail.IsBodyHtml = true;
  220. mail.BodyEncoding = Encoding.ASCII;
  221. mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
  222. mail.Sender = new MailAddress(host.User, "UniVate Properties");
  223. mail.From = mail.Sender;
  224. smtp.UseDefaultCredentials = host.NeedsAuthorize;
  225. smtp.Credentials = host.GetNetworkCredential();
  226. smtp.EnableSsl = host.UseSSL;
  227. smtp.Send(mail);
  228. }
  229. }
  230. public void WeekOfferMadeUser(TimeshareWeek week, BidItem bid)
  231. {
  232. //var recipients = _dbContext.MailRecipients.Where(x => x.RecipientUsage == "WeekOfferMade-User").Where(y => y.IsDeleted == false).ToList();
  233. string body = _dbContext.Templates.Where(x => x.Name == "WeekOfferMade-User").Where(y => y.IsDeleted == false).FirstOrDefault().Body; ;
  234. body = body.Replace("[OWNER]", week.DisplayOwner);
  235. body = body.Replace("[RESORTNAME]", week.ResortName);
  236. body = body.Replace("[UNITNUMBER]", week.UnitNumber);
  237. body = body.Replace("[MODULE]", week.Module);
  238. body = body.Replace("[OFFERMADE]", bid.Amount.ToString());
  239. body = body.Replace("[FULLNAME]", bid.BidMaker.Display);
  240. body = body.Replace("[USEREMAIL]", bid.BidMaker.Email);
  241. body = body.Replace("[USERCELLPHONE]", bid.BidMaker.CellNumber);
  242. body = body.Replace("[USERTELEPHONE]", bid.BidMaker.Telephone);
  243. body = body.Replace("[USERCOMMENT]", bid.Comment);
  244. var host = _dbContext.Hosts.FirstOrDefault();
  245. using (SmtpClient smtp = new SmtpClient(host.Host))
  246. {
  247. MailMessage mail = new MailMessage();
  248. mail.To.Add(bid.BidMaker.Email);
  249. mail.Subject = "Uni-Vate - New Contact Request";
  250. mail.Body = body;
  251. mail.IsBodyHtml = true;
  252. mail.BodyEncoding = Encoding.ASCII;
  253. mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
  254. mail.Sender = new MailAddress(host.User, "UniVate Properties");
  255. mail.From = mail.Sender;
  256. smtp.UseDefaultCredentials = host.NeedsAuthorize;
  257. smtp.Credentials = host.GetNetworkCredential();
  258. smtp.EnableSsl = host.UseSSL;
  259. smtp.Send(mail);
  260. }
  261. }
  262. public void WeekOfferMadeAdmin()
  263. {
  264. }
  265. public void WeekLoadedAgent(TimeshareWeekDto week)
  266. {
  267. string body = _dbContext.Templates.Where(x => x.Name == "WeekLoaded-Agent").Where(y => y.IsDeleted == false).FirstOrDefault().Body;
  268. var recipients = _dbContext.MailRecipients.Where(x => x.RecipientUsage == "WeekLoaded-Agent").Where(y => y.IsDeleted == false).ToList();
  269. #region ResortFields
  270. body = body.Replace("[RESORTNAME]", " " + week.ResortName);
  271. body = body.Replace("[UNITNUMBER]", " " + week.UnitNumber);
  272. body = body.Replace("[MODULE]", " " + week.Module);
  273. body = body.Replace("[RESORTPRICE]", " " + week.SellPrice.ToString());
  274. body = body.Replace("[RESORTSEASON]", " " + week.Season);
  275. body = body.Replace("[RESORTREGION]", " " + week.Region.Display);
  276. body = body.Replace("[RESORTLEVY]", " " + week.LevyAmount.ToString());
  277. body = body.Replace("[OWNER]", " " + week.DisplayOwner);
  278. body = body.Replace("[SLEEPMAX]", " " + week.MaxSleep.ToString());
  279. body = body.Replace("[WEEK]", " " + week.WeekNumber);
  280. body = body.Replace("[BEDROOMS]", " " + week.Bedrooms);
  281. body = body.Replace("[ASKINGPRICE]", " " + week.AskingPrice.ToString());
  282. body = body.Replace("[ARRIVALDATE]", " " + week.ArrivalDate.ToString());
  283. body = body.Replace("[DEPARTUREDATE]", " " + week.DepartureDate.ToString());
  284. body = body.Replace("[AGENTREFER]", week.ReferedByAgent ? " Yes" : " No");
  285. body = body.Replace("[ALLLEVY]", week.LeviesPaidInFull ? " Yes" : " No");
  286. body = body.Replace("[WEEKPLACEDFORRENTAL]", week.WeekPlacedForRental ? " Yes" : " No");
  287. body = body.Replace("[ORIGINALPURCHASEDATE]", " " + week.OriginalPurchaseDate.ToString());
  288. body = body.Replace("[CUROCCUPATIONDATES]", " " + week.ArrivalDate.ToString() + " - " + week.DepartureDate.ToString());
  289. body = body.Replace("[ORIGINALPURCHASEPRICE]", " " + week.OriginalPurchasePrice.ToString());
  290. body = body.Replace("[AGENTCOMM]", " " + week.AgentCommision.ToString());
  291. #endregion
  292. #region UserFields
  293. body = body.Replace("[FULLNAME]", " " + week.DisplayOwner);
  294. body = body.Replace("[USEREMAIL]", " " + week.OwnerObject.EmailAddress);
  295. body = body.Replace("[USERCELLPHONE]", " " + week.OwnerObject.CellNumber);
  296. body = body.Replace("[USERTELEPHONE]", " " + week.OwnerObject.LandlineNumber);
  297. #endregion
  298. string toList = "";
  299. int emailCount = 0;
  300. foreach (var recipient in recipients)
  301. {
  302. toList += recipient.RecipientMail + ", ";
  303. emailCount++;
  304. }
  305. if (toList.Length > 0)
  306. {
  307. if (emailCount == 1)
  308. toList = toList.Substring(0, toList.Length - 2);
  309. else
  310. toList = toList.Substring(0, toList.Length - 2);
  311. }
  312. var host = _dbContext.Hosts.FirstOrDefault();
  313. using (SmtpClient smtp = new SmtpClient(host.Host))
  314. {
  315. MailMessage mail = new MailMessage();
  316. mail.To.Add(toList);
  317. mail.Subject = "Uni-Vate - Week Loaded by Agent";
  318. mail.Body = body;
  319. mail.IsBodyHtml = true;
  320. mail.BodyEncoding = Encoding.ASCII;
  321. mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
  322. mail.Sender = new MailAddress(host.User, "UniVate Properties");
  323. mail.From = mail.Sender;
  324. smtp.UseDefaultCredentials = host.NeedsAuthorize;
  325. smtp.Credentials = host.GetNetworkCredential();
  326. smtp.EnableSsl = host.UseSSL;
  327. smtp.Send(mail);
  328. }
  329. }
  330. public void WeekLoadedOwner(TimeshareWeekDto week)
  331. {
  332. string body = _dbContext.Templates.Where(x => x.Name == "WeekLoaded-Owner").Where(y => y.IsDeleted == false).FirstOrDefault().Body;
  333. var recipients = _dbContext.MailRecipients.Where(x => x.RecipientUsage == "WeekLoaded-Owner").Where(y => y.IsDeleted == false).ToList();
  334. #region ResortFields
  335. body = body.Replace("[RESORTNAME]", " " + week.ResortName);
  336. body = body.Replace("[UNITNUMBER]", " " + week.UnitNumber);
  337. body = body.Replace("[MODULE]", " " + week.Module);
  338. body = body.Replace("[RESORTPRICE]", " " + week.SellPrice.ToString());
  339. body = body.Replace("[RESORTSEASON]", " " + week.Season);
  340. body = body.Replace("[RESORTREGION]", " " + week.Region.Display);
  341. body = body.Replace("[RESORTLEVY]", " " + week.LevyAmount.ToString());
  342. body = body.Replace("[OWNER]", " " + week.DisplayOwner);
  343. body = body.Replace("[SLEEPMAX]", " " + week.MaxSleep.ToString());
  344. body = body.Replace("[WEEK]", " " + week.WeekNumber);
  345. body = body.Replace("[BEDROOMS]", " " + week.Bedrooms);
  346. body = body.Replace("[ASKINGPRICE]", " " + week.AskingPrice.ToString());
  347. body = body.Replace("[ARRIVALDATE]", " " + week.ArrivalDate.ToString());
  348. body = body.Replace("[DEPARTUREDATE]", " " + week.DepartureDate.ToString());
  349. body = body.Replace("[AGENTREFER]", week.ReferedByAgent ? " Yes" : " No");
  350. body = body.Replace("[ALLLEVY]", week.LeviesPaidInFull ? " Yes" : " No");
  351. body = body.Replace("[WEEKPLACEDFORRENTAL]", week.WeekPlacedForRental ? " Yes" : " No");
  352. body = body.Replace("[ORIGINALPURCHASEDATE]", " " + week.OriginalPurchaseDate.ToString());
  353. body = body.Replace("[CUROCCUPATIONDATES]", " " + week.ArrivalDate.ToString() + " - " + week.DepartureDate.ToString());
  354. body = body.Replace("[ORIGINALPURCHASEPRICE]", " " + week.OriginalPurchasePrice.ToString());
  355. body = body.Replace("[AGENTCOMM]", " " + week.AgentCommision.ToString());
  356. #endregion
  357. #region UserFields
  358. body = body.Replace("[FULLNAME]", " " + week.DisplayOwner );
  359. body = body.Replace("[USEREMAIL]", " " + week.OwnerObject.EmailAddress);
  360. body = body.Replace("[USERCELLPHONE]", " " + week.OwnerObject.CellNumber);
  361. body = body.Replace("[USERTELEPHONE]", " " + week.OwnerObject.LandlineNumber);
  362. #endregion
  363. string toList = "";
  364. int emailCount = 0;
  365. foreach (var recipient in recipients)
  366. {
  367. toList += recipient.RecipientMail + ", ";
  368. emailCount++;
  369. }
  370. if (toList.Length > 0)
  371. {
  372. if (emailCount == 1)
  373. toList = toList.Substring(0, toList.Length - 2);
  374. else
  375. toList = toList.Substring(0, toList.Length - 2);
  376. }
  377. var host = _dbContext.Hosts.FirstOrDefault();
  378. using (SmtpClient smtp = new SmtpClient(host.Host))
  379. {
  380. MailMessage mail = new MailMessage();
  381. mail.To.Add(toList);
  382. mail.Subject = "Uni-Vate - Week Loaded";
  383. mail.Body = body;
  384. mail.IsBodyHtml = true;
  385. mail.BodyEncoding = Encoding.ASCII;
  386. mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
  387. mail.Sender = new MailAddress(host.User, "UniVate Properties");
  388. mail.From = mail.Sender;
  389. smtp.UseDefaultCredentials = host.NeedsAuthorize;
  390. smtp.Credentials = host.GetNetworkCredential();
  391. smtp.EnableSsl = host.UseSSL;
  392. smtp.Send(mail);
  393. }
  394. }
  395. public void AddRecipient(MailRecipient rec)
  396. {
  397. if (MyCommon.IsValidEmail(rec.RecipientMail))
  398. {
  399. _dbContext.MailRecipients.Add(rec);
  400. _dbContext.SaveChanges();
  401. }
  402. else
  403. {
  404. throw new Exception();
  405. }
  406. }
  407. public List<MailRecipient> GetMailRecipients()
  408. {
  409. return _dbContext.MailRecipients.Where(x => x.IsDeleted == false).ToList();
  410. }
  411. public MailRecipient GetMailRecipientById(int id)
  412. {
  413. return _dbContext.MailRecipients.Where(x => x.Id == id).FirstOrDefault();
  414. }
  415. public void UpdateMailRecipient(MailRecipient rec)
  416. {
  417. var recipient = _dbContext.MailRecipients.Where(x => x.Id == rec.Id).FirstOrDefault();
  418. if (recipient.RecipientMail != rec.RecipientMail)
  419. {
  420. recipient.RecipientMail = rec.RecipientMail;
  421. }
  422. if (recipient.RecipientName != rec.RecipientName)
  423. {
  424. recipient.RecipientName = rec.RecipientName;
  425. }
  426. if (recipient.RecipientUsage != rec.RecipientUsage)
  427. {
  428. recipient.RecipientUsage = rec.RecipientUsage;
  429. }
  430. _dbContext.MailRecipients.Update(recipient);
  431. _dbContext.SaveChanges();
  432. }
  433. public void DeleteMailRecipient(int id)
  434. {
  435. var rec = _dbContext.MailRecipients.Where(x => x.Id == id).FirstOrDefault();
  436. _dbContext.MailRecipients.Remove(rec);
  437. _dbContext.SaveChanges();
  438. }
  439. public List<MailModel> GetContactUsLog()
  440. {
  441. return _dbContext.CommunicationLog.Where(x => x.ComType == "Contact Us").ToList();
  442. }
  443. public List<MailModel> GetEnquireNowLog()
  444. {
  445. return _dbContext.CommunicationLog.Where(x => x.ComType == "Enquire Now").ToList();
  446. }
  447. }
  448. }