Exemplo n.º 1
0
        public string LoadTemplate(string emailTemplateAlias, long notificationTypeId, string body = null)
        {
            var content = string.Empty;

            var notificationtype = _notificationTypeRepository.GetById(notificationTypeId);

            // No binding exisits between Template and Notification Type. As discussed, using emailTemplateAlias as notification Type
            switch (notificationtype.NotificationTypeAlias)
            {
            case NotificationTypeAlias.ScreeningReminderMail:
            case NotificationTypeAlias.AppointmentConfirmationWithEventDetails:
                var appointmentConfModel = _emailNotificationModelsFactory.GetDummyDataAppointmentConfirmationModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, appointmentConfModel);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.AppointmentBookedInTwentyFourHours:
                var appointmentbookedModel = _emailNotificationModelsFactory.GetDummyAppointmentBookedInTwentyFourHoursModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, appointmentbookedModel);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.LoginIssuesSendUsername:
            case NotificationTypeAlias.EmployeeWelcomeEmailWithUsername:
            case NotificationTypeAlias.CustomerWelcomeEmailWithUsername:
                var welcomWithUNameModel = _emailNotificationModelsFactory.GetDummyDataWelcomeWithUserNameNotificationModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, welcomWithUNameModel);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.LoginIssuesSendResetMail:
            case NotificationTypeAlias.EmployeeWelcomeEmailWithResetMail:
            case NotificationTypeAlias.CustomerWelcomeEmailWithResetMail:
                var welcomeWithPasswordModel = _emailNotificationModelsFactory.GetDummyDataWelcomeWithPasswordNotificationModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, welcomeWithPasswordModel);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.ResetMail:
                var resetPasswordModel = _emailNotificationModelsFactory.GetDummyDataResetModificationModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, resetPasswordModel);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.GiftCertificateAcknowledgmentEmail:
            case NotificationTypeAlias.GiftCertificateClaimCodeEmail:
                var giftCertificateModel = _emailNotificationModelsFactory.GetDummyDataGiftCertificateNotificationModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, giftCertificateModel);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.CriticalCustomer:
                var criticalCustomer = _emailNotificationModelsFactory.GetDummyCriticalCustomerNotificationModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, criticalCustomer);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.PriorityInQueueCustomer:
                var priorityInQueueCustomer = _emailNotificationModelsFactory.GetDummyPriorityInQueueNotificationModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, priorityInQueueCustomer);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.AmountRefundNotification:
                var amountRefund = _emailNotificationModelsFactory.GetDummyAmountRefundNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, amountRefund);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.EvaluationReminder:
                var evalReminder = _emailNotificationModelsFactory.GetDummyEvaluationReminderNotificationModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, evalReminder);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.ResultsReady:
                var resultReady = _emailNotificationModelsFactory.GetDummyResultReadyModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, resultReady);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.ThirtyDaysFromAnnualAnniversaryEmailer:
            case NotificationTypeAlias.OneWeekAfter30DayReminder:
            case NotificationTypeAlias.TwoWeekAfter30DayReminder:
            case NotificationTypeAlias.OnOneYearAnniversaryDate:
                var annualReminder = _emailNotificationModelsFactory.GetDummyAnnualReminderNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, annualReminder);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.SurveyEmailNotification:
                var surveyNotification = _emailNotificationModelsFactory.GetDummySurveyNotificationModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, surveyNotification);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.OneDayAfterProspectCreationFollowup:
            case NotificationTypeAlias.OneWeekAfterProspectCreationFollowup:
            case NotificationTypeAlias.TwoWeekAfterProspectCreationFollowup:
            case NotificationTypeAlias.ThreeWeekAfterProspectCreationFollowup:
            case NotificationTypeAlias.FourWeekAfterProspectCreationFollowup:
            case NotificationTypeAlias.FiveWeekAfterProspectCreationFollowup:
            case NotificationTypeAlias.SixWeekAfterProspectCreationFollowup:
            case NotificationTypeAlias.SevenWeekAfterProspectCreationFollowup:
                var prospectNotification = _emailNotificationModelsFactory.GetDummyProspectCustomerFollowupNotificationViewModel();
                content = this.GetEmailMessagewithdummyData(emailTemplateAlias, body, prospectNotification);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.EventFillingNotification:
                var emailFilling = _emailNotificationModelsFactory.GetDummyEventFillingNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, emailFilling);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.PurchaseShippingNotification:
                var purchaseShipping = _emailNotificationModelsFactory.GetDummyPurchaseShippingNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, purchaseShipping);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.UrgentCustomer:
                var urgentCustomer = _emailNotificationModelsFactory.GetDummyUrgentCustomerNotificationModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, urgentCustomer);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.TestUpsellNotification:
                var testUpsellNotification = _emailNotificationModelsFactory.GetDummyTestUpsellNotificationModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, testUpsellNotification);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.EventResultReadyNotification:
                var eventResultReadyNotification = _emailNotificationModelsFactory.GetDummyEventResultReadyNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, eventResultReadyNotification);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.KynFirstNotification:
            case NotificationTypeAlias.KynSecondNotification:
                var kynNotification = _emailNotificationModelsFactory.GetDummyKynNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, kynNotification);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case EmailTemplateAlias.AppointmentReminder:
                var appointmentReminder = _phoneNotificationModelsFactory.GetDummyScreeningReminderSmsNotificationModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, appointmentReminder);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.AppointmentConfirmation:
                var appointmentConfirmation = _phoneNotificationModelsFactory.GetDummyScreeningReminderSmsNotificationModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, appointmentConfirmation);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.PhysicianPartnerSurveyEmailNotification:
                var ppSurveyNotification = _emailNotificationModelsFactory.GetDummySurveyNotificationModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, ppSurveyNotification);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.PhysicianPartnersCustomerResultReady:
                var ppCustomerResultReady = _emailNotificationModelsFactory.GetDummyPpCustomerResultNotificationModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, ppCustomerResultReady);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.EventFullNotification:
                var emailEventFull = _emailNotificationModelsFactory.GetDummyEventFillingNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, emailEventFull);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.LoginOtpEmailNotification:
                var emailNotif = _emailNotificationModelsFactory.GetDummyLoginOtpEmailNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, emailNotif);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.LoginOtpSmsNotification:
                var smsNotif = _phoneNotificationModelsFactory.GetDummyUserLoginOtpModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, smsNotif);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.CustomerTagUpdated:
                var customerTagChangeNotif = _emailNotificationModelsFactory.GetDummyCustomerTagChangeNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, customerTagChangeNotif);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.EventLocked:
                var eventLockedNotification = _emailNotificationModelsFactory.GetDummyEventLockedNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, eventLockedNotification);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.NoShowCustomer:
                var noshowCustomerNotification = _emailNotificationModelsFactory.GetDummyNoShowCustomerNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, noshowCustomerNotification);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.CorporateUploadNotification:
                var corporateUploadNotification = _emailNotificationModelsFactory.GetDummyCorporateUploadNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, corporateUploadNotification);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.DirectMailActivityNotification:
                var directEmailNotificationViewModel = _emailNotificationModelsFactory.GetDummyDirectMailActivityNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, directEmailNotificationViewModel);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.IneligibleCustomerAppointmentNotification:
                var directIneligibleCustomerAppointmentNotificationViewModel = _emailNotificationModelsFactory.GetDummyIneligibleCustomerAppointmentNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, directIneligibleCustomerAppointmentNotificationViewModel);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.ExportToCsvNotification:
                var directcustomerExportNotificationtNotificationViewModel = _emailNotificationModelsFactory.GetDummyCustomerExportableReportsNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, directcustomerExportNotificationtNotificationViewModel);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.CancelRescheduleAppointmentNotification:
                var cancellationRescheduleNotificationViewModel = _emailNotificationModelsFactory.GetDummyCancelRescheduleAppointmentNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, cancellationRescheduleNotificationViewModel);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.PatientLeftNotification:
                var patientLeftNotificationViewModel = _emailNotificationModelsFactory.GetDummyPatientLeftNotificationModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, patientLeftNotificationViewModel);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.CustomEventSmsNotification:
                var customEventSmsNotificationModel = _phoneNotificationModelsFactory.GetDummyCustomEventSmsNotificatonModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, customEventSmsNotificationModel);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.RecordSendBackForCorrection:
                var recordSendBackForCorrectionNotificationModel = _emailNotificationModelsFactory.GetDummyRecordSendBackForCorrectionNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, recordSendBackForCorrectionNotificationModel);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.HourlyNotificationAppointmentBookedReport:
                var hourlyNoitificationAppointment = _emailNotificationModelsFactory.GetDummyHourlyAppointmentBookedReportNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, hourlyNoitificationAppointment);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.HourlyNotificationOutreachCallReport:
                var hourlyOutreachReport = _emailNotificationModelsFactory.GetDummyHourlyOutreachNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, hourlyOutreachReport);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.MergeCustomer:
                var mergeCustomerModel = _emailNotificationModelsFactory.GetDummyMergeCustomerViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, mergeCustomerModel);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.WrongSmsReponse:
                var wrongSmsReponse = _phoneNotificationModelsFactory.GetDummyWrongSmsResponseNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, wrongSmsReponse);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.WellcomeSmsMessage:
                var wellcomeSmsNotification = _phoneNotificationModelsFactory.GetDummyWellcomeSmsNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, wellcomeSmsNotification);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.FileNotPosted:
                var fileNotPostedModel = _emailNotificationModelsFactory.GetDummyFileNotPostedViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, fileNotPostedModel);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.TestNotPerformedSupplyIssue:
                var testNotPerformedSupplyIssue = _emailNotificationModelsFactory.GetDummyTestNotPerformedEmailNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, testNotPerformedSupplyIssue);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.TestNotPerformedEquipmentMalfunction:
                var testNotPerformedEquipmentMalfunction = _emailNotificationModelsFactory.GetDummyTestNotPerformedEmailNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, testNotPerformedEquipmentMalfunction);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.ReTestNotification:
                var reTestNotification = _emailNotificationModelsFactory.GetDummyReTestNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, reTestNotification);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.NonTargetedMemberRegistrationNotification:
                var nonTargetedMemberRegistrationNotification = _emailNotificationModelsFactory.GetDummyNonTargetedMemberRegistrationNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, nonTargetedMemberRegistrationNotification);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.MammoPatientRegistrationOnNonMammoEventNotification:
                var mammoPatientRegistrationOnNonMammoEventNotification = _emailNotificationModelsFactory.GetDummyMammoPatientRegestrationOnNonMammoEventViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, mammoPatientRegistrationOnNonMammoEventNotification);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.SingleTestOverrideNotification:
                var singleTestOverrideNotification = _emailNotificationModelsFactory.GetDummySingleTestOverrideNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, singleTestOverrideNotification);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.NPfordiagnosingwithlinkNotification:
                var NPfordiagnosingwithlinkNotification = _emailNotificationModelsFactory.GetDummyNPfordiagnosingwithlinkNotificationViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, NPfordiagnosingwithlinkNotification);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.CoverLetterTemplate:
                var coverLetterTemplate = _emailNotificationModelsFactory.GetDummyCoverLetterTemplateViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, coverLetterTemplate);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.ListWithoutCustomTags:
                var listWithoutCustomTags = _emailNotificationModelsFactory.GetDummyListWithoutCustomTagsViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, listWithoutCustomTags);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;

            case NotificationTypeAlias.AbsenceByMember:
                var AbsenceByMemberModel = _emailNotificationModelsFactory.GetDummyAbsenceByMemberPostedViewModel();
                content = GetEmailMessagewithdummyData(emailTemplateAlias, body, AbsenceByMemberModel);
                if (!string.IsNullOrEmpty(content))
                {
                    return(content);
                }
                break;
            }

            return(content);
        }