示例#1
0
        public static void SendNotice(NoticeType thisNotice, List <string> emailRecipients,
                                      string facultyName, string studentName, string studentID, string courseSection, string dropDate, string lastDate)
        {
            if (thisNotice != NoticeType.NoNotice)
            {
                string messageText = NoticeText.GetNoticeText(thisNotice);
                string subjectText = NoticeText.GetSubjectText(thisNotice);

                messageText = messageText.Replace("FACULTY_NAME", facultyName).Replace("STUDENT_NAME", studentName).Replace("STUDENT_ID", studentID).Replace("COURSE_SECTION", courseSection).Replace("DROP_DATE", dropDate).Replace("LAST_DATE", lastDate);

                SendGenericNotification(subjectText, messageText, emailRecipients);
                // extra insurance to not send emails to faculty when testing or debugging
                //SendGenericNotification(subjectText, messageText, (new string[] {"*****@*****.**"}).ToList());
            }
        }
        public void Execute(string interactionId, NoticeType noticeType, string notice)
        {
            try
            {
                RequestNotify reqNotify = RequestNotify.Create(
                    interactionId, Visibility.All,
                    NoticeText.Create(noticeType, notice), null, null);

                BaseAction action = new ChatNoticeAction(Protocol);

                action.Request = reqNotify;

                base.CloneSubscription(ref action);

                action.Execute();
            }
            catch (Exception ex)
            {
                ChatLog.GetInstance().LogException(ex);
            }
        }