Created
October 25, 2018 05:19
-
-
Save KevinDJones/c4bdcab8ababedfbb66666aa20f74508 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[FunctionName("A_SendTwilioText")] | |
public static async Task SendTwilioText( | |
[ActivityTrigger] MessageInput input, | |
[TwilioSms] IAsyncCollector<CreateMessageOptions> message, | |
ILogger log) | |
{ | |
log.LogWarning($"Twilio Activity. Sending message"); | |
CreateMessageOptions smsText = new CreateMessageOptions(new PhoneNumber(input.Phone)) | |
{ | |
From = new PhoneNumber(Environment.GetEnvironmentVariable("TwilioNumber")), | |
Body = input.Message, | |
StatusCallback = new Uri(Environment.GetEnvironmentVariable("Host") + "/api/TwilioHandler/" + input.SmsKey) | |
}; | |
await message.AddAsync(smsText); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment