CPE_learningsite
This repository has no backups
This repository's network speed is throttled to 100KB/sec
Upgrade your account to fix these warnings, or use backups.vc for automated backups
4cd176a439ea516368a5d8827cdf8726027259a6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
/* Developer: Tyler Allen Date Created: 08/24/2016 --------------------------------------------------- */ using System; using System.Configuration; using System.IO; namespace CPE.App.NotifyConsole.Helpers { public static class EmailRenderHelper { public static string EmailBody { get { string filePath = $"{ConfigurationManager.AppSettings["CertificateEmailBody"]}"; return File.ReadAllText(filePath); } } public static string WebcastEmailBody { get { string filePath = $"{ConfigurationManager.AppSettings["WebcastCertificateEmailBody"]}"; return File.ReadAllText(filePath); } } public static string FailEmailBody { get { string filePath = $"{ConfigurationManager.AppSettings["WebcastFailEmailBody"]}"; return File.ReadAllText(filePath); } } public static string RenderEmail(string contentUrl, DateTime? certificateDate, string ticket) { if(!certificateDate.HasValue) { return string.Empty; } var emailBody = EmailBody; var certLink = ConfigurationManager.AppSettings["CertLink"]; var certURl = string.Format(certLink, contentUrl, certificateDate.Value.ToString("yyyyMMdd"), ticket); return emailBody.Replace("certUrl", certURl); } public static string RenderWebcastEmail(string certURl) { var emailBody = WebcastEmailBody; return emailBody.Replace("certUrl", certURl); } public static string RenderCertificateLink(int meetingSco, DateTime purchaseDate, string ticket) { var meetingUrl = meetingSco.ToString(); var certLink = ConfigurationManager.AppSettings["CertLink"]; var certURl = string.Format(certLink, meetingUrl, purchaseDate.ToString("yyyyMMdd"), ticket); return certURl; } public static string RenderFailEmail() { var emailBody = FailEmailBody; return emailBody; } } } |
Commits for CPE_learningsiteCPE/CPE.App/CPE.App.NotifyConsole/Helpers/EmailHelper.cs
Revision | Author | Commited | Message |
---|---|---|---|
4cd176 ... | v.shishlov | Fri 27 Aug, 2021 14:33:17 +0000 | initial commit |