public void ShareBcTests_ShareQuestion() { var shareRequestModel = new ShareRequestModel { DestinationEmail = "*****@*****.**", ContentUrl = $"<h2>Share Question</h2><p style='font-size: 1.2em;'> (Question Example)</p>" }; var share = shareBc.ShareQuestion(shareRequestModel); Assert.IsTrue(share); }
public bool ShareQuestion(ShareRequestModel requestModel) { var sent = emailDataAgent.Send(new[] { requestModel.DestinationEmail }, null, null, "Share", requestModel.ContentUrl); if (sent) { return(sent); } else { throw new BlissException(CommonExceptionResources.InvalidShare); } }
public async Task <IHttpActionResult> ShareQuestion( [FromUri] ShareRequestModel requestModel, CancellationToken cancellationToken = default(CancellationToken)) { return(await ExecuteAsync <IHttpActionResult>(() => { if (!ModelState.IsValid) { throw new BlissException(CommonExceptionResources.AllFieldsMandatory); } var share = shareBc.ShareQuestion(requestModel); return Ok(new BaseExceptionResponseModel { Status = "OK" }); }, cancellationToken)); }