Sequencing.WeatherApp.Controllers.AppChain.SqApiServiceFacade.SendUserNotification C# (CSharp) Method

SendUserNotification() public method

Sends user onsite notification
public SendUserNotification ( string msg ) : void
msg string message to user
return void
        public void SendUserNotification(string msg)
        {
            var _restClient = CreateClient();
            var _restRequest = CreateRq("UserAlertNotify", Method.POST);
            _restRequest.AddParameter(new Parameter
            {
                Name = "application/json",
                Value = JsonConvert.SerializeObject(new UserNotification
                                                    {
                                                        PlainTextBody = msg,
                                                        NotificationUrl = Options.BaseSiteUrl,
                                                        SendOnSite = true
                                                    }),
                Type = ParameterType.RequestBody
            });
            var _restResponse = RunRq(_restClient, _restRequest);
            LogManager.GetLogger(GetType()).DebugFormat("SendUserNotification:{0}", _restResponse.Content);
        }

Usage Example

コード例 #1
0
 private void SendOnSiteNotification(SendInfo info, string msg1)
 {
     var _srv = new SqApiServiceFacade(Options.ApiUrl, info.UserName);
     _srv.SendUserNotification(msg1);
 }