private MagnetMessage CreateMessage(TwilioSmsRequest twilioSmsRequest) { var properties = new Dictionary <string, string>(); properties.Add("Twilio-Message-ID", twilioSmsRequest.SmsSid); return(new MagnetMessage { Type = "Sms", Provider = "Twilio", ReceivedAt = DateTime.UtcNow, From = twilioSmsRequest.From, To = new List <string> { twilioSmsRequest.To }, Body = twilioSmsRequest.Body, Properties = properties, }); }
public async Task <IActionResult> Sms(TwilioSmsRequest smsRequest) { await _messageSink.ProcessMessageAsync(CreateMessage(smsRequest)); return(Ok()); }