From 6b9bcacb61b44f1aa4bbadc0d6f28a2277cd0d41 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 24 Oct 2024 15:43:05 -0400 Subject: [PATCH] Sms Message should be sent to Phone Number (#16925) --- .../Services/SmsNotificationProvider.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/OrchardCore/OrchardCore.Sms.Core/Services/SmsNotificationProvider.cs b/src/OrchardCore/OrchardCore.Sms.Core/Services/SmsNotificationProvider.cs index 8c4761d6a84..71f78b5b7c0 100644 --- a/src/OrchardCore/OrchardCore.Sms.Core/Services/SmsNotificationProvider.cs +++ b/src/OrchardCore/OrchardCore.Sms.Core/Services/SmsNotificationProvider.cs @@ -25,18 +25,18 @@ public async Task TrySendAsync(object notify, INotificationMessage message { var user = notify as User; - if (string.IsNullOrEmpty(user?.Email)) + if (string.IsNullOrEmpty(user?.PhoneNumber)) { return false; } - var mailMessage = new SmsMessage() + var smsMessage = new SmsMessage() { - To = user.Email, + To = user.PhoneNumber, Body = message.TextBody, }; - var result = await _smsService.SendAsync(mailMessage); + var result = await _smsService.SendAsync(smsMessage); return result.Succeeded; }