Esempio n. 1
0
File: Email.cs Progetto: apxlee/SAP
        public static bool SendTaskEmail(EmailTaskType taskType, string toEmailAddress, string toName, long requestId, string affectedEndUser, WorkflowState workflowState, string reason)
        {
            string recipientName = string.Empty;
            string followPageName = string.Empty;
            string subjectAction = GetSubjectAction;
            string templatePath = Utilities.AbsolutePath;

            switch (taskType)
            {
                case EmailTaskType.AccessTeamAcknowledge:
                    recipientName = "Access Team";
                    followPageName = PageNames.ACCESS_TEAM;
                    subjectAction += "Acknowledgement Needed";
                    templatePath += ConfigurationManager.AppSettings["Acknowledgement"];
                    break;

                case EmailTaskType.OverdueApproval:
                    recipientName = toName;
                    followPageName = PageNames.APPROVING_MANAGER;
                    subjectAction += "Approval Reminder";
                    templatePath += ConfigurationManager.AppSettings["NagApproval"];
                    break;

                /*
                case EmailTaskType.OverdueApprovalCC:
                    recipientName = toName;
                    followPageName = PageNames.APPROVING_MANAGER;
                    subjectAction = string.Format("{0}Approval is Overdue (FYI: You are copied on this email)", subjectAction);
                    templatePath += ConfigurationManager.AppSettings["NagApproval"];
                    break;
                 */

                case EmailTaskType.OverdueChangeRequested:
                    recipientName = toName;
                    followPageName = PageNames.USER_VIEW;
                    subjectAction += "Change Requested Reminder";
                    templatePath += ConfigurationManager.AppSettings["NagChangeRequested"];
                    break;

                case EmailTaskType.AssignToApprover:
                    recipientName = toName;
                    followPageName = PageNames.APPROVING_MANAGER;
                    subjectAction += "Approval Needed";
                    templatePath += ConfigurationManager.AppSettings["Approval"];
                    break;

                case EmailTaskType.ProxyForAffectedEndUser:
                    recipientName = toName;
                    followPageName = PageNames.USER_VIEW;
                    subjectAction += "Submitted";
                    templatePath += ConfigurationManager.AppSettings["RequestorForAEU"];
                    break;

                case EmailTaskType.TransitionToPendingProvisioning:
                    recipientName = "Access Team";
                    followPageName = PageNames.ACCESS_TEAM;
                    subjectAction += "Pending Provisioning";
                    templatePath += ConfigurationManager.AppSettings["TransitionToPendingProvisioning"];
                    break;

                case EmailTaskType.UpdateRequester:
                    recipientName = toName;

                    switch (workflowState)
                    {
                        case WorkflowState.Pending_Acknowledgement:
                            subjectAction += "Submitted";
                            followPageName = PageNames.USER_VIEW;
                            templatePath += ConfigurationManager.AppSettings["ConfirmSubmitToSubmitter"];
                            break;

                        case WorkflowState.Closed_Completed:
                            subjectAction += "Completed";
                            followPageName = PageNames.USER_VIEW;
                            templatePath += ConfigurationManager.AppSettings["CompleteToSubmitter"];
                            break;

                        case WorkflowState.Change_Requested:
                            subjectAction += "Change Has Been Requested";
                            followPageName = PageNames.REQUEST_FORM;
                            templatePath += ConfigurationManager.AppSettings["RequestChangeToSubmitter"];
                            break;

                        case WorkflowState.Closed_Denied:
                            subjectAction += "Denied";
                            followPageName = PageNames.USER_VIEW;
                            templatePath += ConfigurationManager.AppSettings["DenyToSubmitter"];
                            break;

                        case WorkflowState.Closed_Cancelled:
                            subjectAction += "Cancelled";
                            followPageName = PageNames.USER_VIEW;
                            templatePath += ConfigurationManager.AppSettings["DenyToSubmitter"];
                            break;
                        case WorkflowState.Closed_Abandon:
                            subjectAction += "Abandoned";
                            followPageName = PageNames.USER_VIEW;
                            templatePath += ConfigurationManager.AppSettings["DenyToSubmitter"];
                            break;

                    }
                    break;
            }

            Hashtable bodyParameters = new Hashtable()
                {
                    {"ROOT_PATH", Utilities.WebRootUrl},
                    {"IMAGE_PATH", Utilities.ImagePath},
                    {"RECIPIENT_NAME", recipientName},
                    {"AFFECTED_END_USER", affectedEndUser},
                    {"FOLLOW_URL", Utilities.WebRootUrl + followPageName + ".aspx?requestId=" +  requestId},
                    {"REASON", reason},
                    {"REQUEST_ID", requestId}
                };

            return SendEmail(toEmailAddress, subjectAction, templatePath, bodyParameters);
        }
Esempio n. 2
0
File: Email.cs Progetto: apxlee/SAP
 public static bool SendTaskEmail(EmailTaskType taskType, string toEmailAddress, string toName, long requestId, string affectedEndUser)
 {
     return SendTaskEmail(taskType, toEmailAddress, toName, requestId, affectedEndUser, WorkflowState.Not_Active, null);
 }