public async Task <ActionResult <SendTextModel> > SendText(SendTextModel newTextData) { //data validation and filtering. if going into a database one could encode on entry //log data from the request and what they attempted to request with. Might want to encode this is you are not validation before logging. var response = await Task.Run(() => _redirect.Post(newTextData)); return(Ok(response)); }
public async Task <ActionResult <SendMailModel> > SendMail(SendMailModel newMailData) { //data validation and filtering //log data from the request and what they attempted to request with. Might want to encode this is you are not validation before logging. if (newMailData.from.email == null || newMailData.from.email == "") //auto generate a noreply address if there was no data filled in in the call { //could potentially create a service to create custom messages based on the occasion newMailData.from.email = "*****@*****.**"; } //This will redirect the data that has been filtered to our Redirecting service. var response = await Task.Run(() => _redirect.Post(newMailData) ); if (response != "Success") { return(StatusCode(StatusCodes.Status500InternalServerError, "could not contact third party service")); } return(Ok(response)); }