public IHttpActionResult RenderNotificationContent(webModels.TestNotificationRequest request)
        {
            var retVal       = new webModels.RenderNotificationContentResult();
            var notification = _notificationManager.GetNewNotification(request.Type, request.ObjectId, request.ObjectTypeId, request.Language);

            foreach (var param in request.NotificationParameters)
            {
                var property = notification.GetType().GetProperty(param.Key);
                var jObject  = param.Value as Newtonsoft.Json.Linq.JObject;
                if (jObject != null)
                {
                    property.SetValue(notification, jObject.ToObject <Dictionary <string, string> >());
                }
                else
                {
                    property.SetValue(notification, param.Value);
                }
            }
            _eventTemplateResolver.ResolveTemplate(notification);

            retVal.Subject = notification.Subject;
            retVal.Body    = notification.Body;

            return(Ok(retVal));
        }
        public IHttpActionResult RenderNotificationContent(webModels.TestNotificationRequest request)
        {
            var retVal       = new webModels.RenderNotificationContentResult();
            var notification = _notificationManager.GetNewNotification(request.Type, request.ObjectId, request.ObjectTypeId, request.Language);

            foreach (var param in request.NotificationParameters)
            {
                SetValue(notification, param);
            }
            _eventTemplateResolver.ResolveTemplate(notification);

            retVal.Subject = notification.Subject;
            retVal.Body    = notification.Body;

            return(Ok(retVal));
        }
Esempio n. 3
0
        public IHttpActionResult RenderNotificationContent([FromBody] List <KeyValuePair <string, string> > parameters, string type, string objectId, string objectTypeId, string language)
        {
            var retVal       = new webModels.RenderNotificationContentResult();
            var notification = _notificationManager.GetNewNotification(type, objectId, objectTypeId, language);

            foreach (var param in parameters)
            {
                var property = notification.GetType().GetProperty(param.Key);
                property.SetValue(notification, param.Value);
            }
            _eventTemplateResolver.ResolveTemplate(notification);

            retVal.Subject = notification.Subject;
            retVal.Body    = notification.Body;

            return(Ok(retVal));
        }
        public IHttpActionResult RenderNotificationContent(webModels.TestNotificationRequest request)
        {
            var retVal = new webModels.RenderNotificationContentResult();
            var notification = _notificationManager.GetNewNotification(request.Type, request.ObjectId, request.ObjectTypeId, request.Language);
            foreach (var param in request.NotificationParameters)
            {
                var property = notification.GetType().GetProperty(param.Key);
                var jObject = param.Value as Newtonsoft.Json.Linq.JObject;
                if (jObject != null)
                {
                    property.SetValue(notification, jObject.ToObject<Dictionary<string, string>>());
                }
                else
                {
                    property.SetValue(notification, param.Value);
                }
            }
            _eventTemplateResolver.ResolveTemplate(notification);

            retVal.Subject = notification.Subject;
            retVal.Body = notification.Body;

            return Ok(retVal);
        }
        public IHttpActionResult RenderNotificationContent(webModels.TestNotificationRequest request)
        {
            var retVal = new webModels.RenderNotificationContentResult();
            var notification = _notificationManager.GetNewNotification(request.Type, request.ObjectId, request.ObjectTypeId, request.Language);
            foreach (var param in request.NotificationParameters)
            {
                SetValue(notification, param);
            }
            _eventTemplateResolver.ResolveTemplate(notification);

            retVal.Subject = notification.Subject;
            retVal.Body = notification.Body;

            return Ok(retVal);
        }
		public IHttpActionResult RenderNotificationContent([FromBody]List<KeyValuePair<string, string>> parameters, string type, string objectId, string objectTypeId, string language)
		{
            var retVal = new webModels.RenderNotificationContentResult();
			var notification = _notificationManager.GetNewNotification(type, objectId, objectTypeId, language);
			foreach (var param in parameters)
			{
				var property = notification.GetType().GetProperty(param.Key);
				property.SetValue(notification, param.Value);
			}
			_eventTemplateResolver.ResolveTemplate(notification);

            retVal.Subject = notification.Subject;
            retVal.Body = notification.Body;

            return Ok(retVal);
		}