Пример #1
0
        private static string GetPlainTextMessage(KidsInformationEmailModel reminder)
        {
            var message = File.ReadAllText(HostingEnvironment.MapPath("~/PlainTextEmail.txt"));

            message = message.Replace("{vchildname}", reminder.KName);
            message = message.Replace("{vparentname}", reminder.ParentsName);

            var dob = new DateTime(DateTime.Now.Year, reminder.MonthofBirth, reminder.DayofBirth);

            message = message.Replace("{vbirthdate}", dob.ToString("dd-MMM"));

            return(message);
        }
Пример #2
0
        private static string GetHTMLMessageBody(KidsInformationEmailModel remainder)
        {
            var message = File.ReadAllText(HostingEnvironment.MapPath("~/emailtemplate.html"));

            message = message.Replace("vchildname", remainder.KName);
            message = message.Replace("vparentname", remainder.ParentsName);

            var dob = new DateTime(DateTime.Now.Year, remainder.MonthofBirth, remainder.DayofBirth);

            message = message.Replace("vbirthdate", dob.ToString("dd-MMM"));

            return(message);
        }