示例#1
0
        private string FillSMSTemplate(StudentAlertModel s)
        {
            var template       = loadSmsTemplate();
            var filledTemplate = template.Replace("{{AlertContent}}", $"has a new missing assignment, for a total of {s.ValueCount}." +
                                                  $"\r\nFor details visit the Parent Portal.")
                                 .Replace("{{StudentFullName}}", $"{s.FirstName} {s.LastSurname}");

            return(filledTemplate);
        }
示例#2
0
        private string FillSMSTemplate(StudentAlertModel s)
        {
            var template       = loadSmsTemplate();
            var filledTemplate = template.Replace("{{AlertContent}}", $"has {s.ValueCount} grades below threshold:" + AddCoursesToSMSTemplate(s.Courses) +
                                                  $"\r\nFor details visit the Family Portal.")
                                 .Replace("{{StudentFullName}}", $"{s.FirstName} {s.LastSurname}");

            return(filledTemplate);
        }
        private string FillSMSTemplate(StudentAlertModel s)
        {
            var template       = loadSmsTemplate();
            var filledTemplate = template.Replace("{{AlertContent}}", $"has {s.AbsenceCount} absences:" +
                                                  $"\r\n- Excused Absence: {s.ExcusedCount}\r\n- Unexcused Absence: {s.UnexcusedCount}\r\n- Tardy Absence: {s.TardyCount}." +
                                                  $"\r\nFor details visit the Parent Portal.")
                                 .Replace("{{StudentFullName}}", $"{s.FirstName} {s.LastSurname}");

            return(filledTemplate);
        }
示例#4
0
        private string FillEmailTemplate(StudentAlertModel s, ThresholdTypeModel thresholdType, string imageUrl)
        {
            var template       = loadEmailTemplate();
            var filledTemplate = template.Replace("{{StudentAlertMessage}}", $"Your student has {s.ValueCount} missing assignments.")
                                 .Replace("{{StudentFullName}}", $"{s.FirstName} {s.LastSurname}")
                                 .Replace("{{StudentLocalId}}", s.StudentUSI.ToString())
                                 .Replace("{{StudentImageUrl}}", imageUrl)
                                 .Replace("{{MetricTitle}}", "Missing Assignments at or above threshold")
                                 .Replace("{{MetricValue}}", $"{s.ValueCount}/{thresholdType.ThresholdValue}")
                                 .Replace("{{StudentDetailUrl}}", _urlProvider.GetStudentDetailUrl(s.StudentUSI))
                                 .Replace("{{WhatCanParentDo}}", thresholdType.WhatCanParentDo);

            return(filledTemplate);
        }
示例#5
0
        private string FillEmailTemplate(StudentAlertModel s, ThresholdTypeModel thresholdType, string imageUrl)
        {
            var template       = loadEmailTemplate();
            var filledTemplate = template.Replace("{{StudentAlertMessage}}", $"Your student has {s.ValueCount} grades below threshold.")
                                 .Replace("{{StudentFullName}}", $"{s.FirstName} {s.LastSurname}")
                                 .Replace("{{StudentLocalId}}", s.StudentUSI.ToString())
                                 .Replace("{{StudentImageUrl}}", imageUrl)
                                 .Replace("{{MetricTitle}}", "")
                                 .Replace("{{MetricValue}}", $"{AddCoursesToMailTemplate(s.Courses)}")
                                 .Replace("{{StudentDetailUrl}}", _urlProvider.GetStudentDetailUrl(s.StudentUSI))
                                 .Replace("{{WhatCanParentDo}}", thresholdType.WhatCanParentDo);

            return(filledTemplate);
        }
        private string FillEmailTemplate(StudentAlertModel s, ThresholdTypeModel excusedThreshold, ThresholdTypeModel unexcusedThreshold, ThresholdTypeModel tardyThreshold, string imageUrl)
        {
            var template = loadEmailTemplate();

            var filledTemplate = template.Replace("{{StudentAlertMessage}}", $"Your student has {s.AbsenceCount} absences.")
                                 .Replace("{{StudentFullName}}", $"{s.FirstName} {s.LastSurname}")
                                 .Replace("{{StudentLocalId}}", s.StudentUSI.ToString())
                                 .Replace("{{StudentImageUrl}}", imageUrl)
                                 .Replace("{{MetricTitle}}", "Absences at or above threshold")
                                 .Replace("{{MetricValue}}", $"<ul><li style='text-align:left'>Excused: {s.ExcusedCount}/{excusedThreshold.ThresholdValue}</li><li style='text-align:left'>Unexcused: {s.UnexcusedCount}/{unexcusedThreshold.ThresholdValue}</li><li style='text-align:left'>Tardy: {s.TardyCount}/{tardyThreshold.ThresholdValue}</li></ul>")
                                 .Replace("{{StudentDetailUrl}}", _urlProvider.GetStudentDetailUrl(s.StudentUSI))
                                 .Replace("{{WhatCanParentDo}}", excusedThreshold.WhatCanParentDo);

            return(filledTemplate);
        }