public async Task <SendToClientSetRes> SendToClientMail([FromBody] SendToClientSetReq request) { var response = new SendToClientSetRes(); try { if (request != null) { response = await _agentApprovalRepository.SendToClientMail(request); } else { response.ResponseStatus.Status = "Failure"; response.ResponseStatus.ErrorMessage = "Details can not be blank."; } if (!string.IsNullOrEmpty(response.ResponseStatus.Status) && response.ResponseStatus.Status == "Success" && !string.IsNullOrEmpty(request.QRFID) && !string.IsNullOrEmpty(request.VoyagerUserId)) { //Task.Run(() => _mSDynamicsRepository.CreateUpdateOpportnity(request.QRFID, request.VoyagerUserId).Result); Task.Run(() => _mSDynamicsRepository.CreateUpdateQuotation(request.QRFID, request.VoyagerUserId).Result); } } catch (Exception ex) { response.ResponseStatus.Status = "Failure"; response.ResponseStatus.ErrorMessage = "An Error Occurs :- " + ex.Message; } return(response); }
public IActionResult SendToClientMail(SendToClientSetReq model) { //OutlookApp outlookApp = new OutlookApp(); //MailItem mailItem = (MailItem)outlookApp.CreateItem(OlItemType.olMailItem); //mailItem.Subject = "This is the subject"; //mailItem.HTMLBody = model.SendToClientHtml; ////Set a high priority to the message //mailItem.Importance = OlImportance.olImportanceHigh; //mailItem.Display(false); //return Json(new //{ // status = "", // msg = "" //}); model.UserName = ckUserName; model.VoyagerUserId = ckLoginUser_Id; SendToClientSetRes objSendToClientSetRes = agentApprovalMapping.SendToClientMail(model, token); return(Json(new { status = objSendToClientSetRes.ResponseStatus.Status, msg = objSendToClientSetRes.ResponseStatus.ErrorMessage })); }
public async Task <SendToClientSetRes> SendToClientMail(SendToClientSetReq sendToClientSetReq, string ticket) { SendToClientSetRes sendToClientSetRes = new SendToClientSetRes(); sendToClientSetRes = await serviceProxy.PostData(_configuration.GetValue <string>("AgentApproval:SendToClientMail"), sendToClientSetReq, typeof(SendToClientSetRes), ticket); return(sendToClientSetRes); }
public SendToClientSetRes SendToClientMail(SendToClientSetReq request, string token) { SendToClientSetRes objSendToClientSetRes = new SendToClientSetRes() { ResponseStatus = new ResponseStatus() }; try { objSendToClientSetRes = agentApprovalProviders.SendToClientMail(request, token).Result; objSendToClientSetRes = objSendToClientSetRes != null ? objSendToClientSetRes : new SendToClientSetRes(); } catch (Exception ex) { objSendToClientSetRes.ResponseStatus.Status = "Failure"; objSendToClientSetRes.ResponseStatus.ErrorMessage = "An Error Occurs:- " + ex.Message; } return(objSendToClientSetRes); }