Move it inside a try block so it doesn’t error out
This commit is contained in:
parent
587c21fa03
commit
4700b09caf
|
|
@ -40,6 +40,9 @@ namespace TwilioSMSReceiver.Common.MessageHandlers
|
||||||
|
|
||||||
public async Task<bool> RelaySms(SMSModel model)
|
public async Task<bool> RelaySms(SMSModel model)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var graphClient = BuildGraphClient();
|
||||||
var message = new Message
|
var message = new Message
|
||||||
{
|
{
|
||||||
Subject = $"Received SMS from {model.SenderNumber} to {model.SenderNumber}",
|
Subject = $"Received SMS from {model.SenderNumber} to {model.SenderNumber}",
|
||||||
|
|
@ -54,15 +57,12 @@ namespace TwilioSMSReceiver.Common.MessageHandlers
|
||||||
{
|
{
|
||||||
EmailAddress = new EmailAddress
|
EmailAddress = new EmailAddress
|
||||||
{
|
{
|
||||||
Address = "frannis@contoso.onmicrosoft.com"
|
Address = _configuration.GetSection("GraphSmtp")["destEmail"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var graphClient = BuildGraphClient();
|
|
||||||
await graphClient.Me.SendMail(message).Request().PostAsync();
|
await graphClient.Me.SendMail(message).Request().PostAsync();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue