Exemple #1
0
        public ITemplates GetTemplateHandler(TemplateGenerateView templateGenerateView, string JsonData)
        {
            var templateHandler = SetHandler(templateGenerateView);

            templateGenerateView.JsonData = JsonData;
            templateHandler.TemplateView  = templateGenerateView;
            return(templateHandler);
        }
Exemple #2
0
        public ITemplates GetTemplateHandler(TemplateGenerateView templateGenerateView)
        {
            var templateHandler = SetHandler(templateGenerateView);

            //if (loadedUrl != templateGenerateView.FeatureEndPoint)
            //{
            //    loadedUrl = templateGenerateView.FeatureEndPoint;
            //    templateGenerateView.JsonData = GetDataForTemplate(templateGenerateView.FeatureEndPoint,
            //        templateGenerateView.Parameters);
            //}
            //templateGenerateView.JsonData = "{'to':['*****@*****.**','*****@*****.**']}";
            templateGenerateView.EMailDataView = _dataHandler("SMS").GetMessageData(templateGenerateView.MessageId);
            templateHandler.TemplateView       = templateGenerateView;
            return(templateHandler);
        }
Exemple #3
0
        private ITemplates SetHandler(TemplateGenerateView templateGenerateView)
        {
            var templateHandler = _templateSelectors(templateGenerateView.NotificationType);

            if (templateHandler == null)
            {
                throw new InvalidOperationException($"Template handler not defined for " +
                                                    $"{templateGenerateView.NotificationType.ToString()}");
            }

            var template = _notificationtemplate.GetTemplate();

            templateHandler.Template = template ?? throw new KeyNotFoundException($"Template not found for " +
                                                                                  $"SMS");

            return(templateHandler);
        }