diff --git a/EnvelopeGenerator.Application/Contracts/IMessagingService.cs b/EnvelopeGenerator.Application/Contracts/IMessagingService.cs index ff84a5f5..09048206 100644 --- a/EnvelopeGenerator.Application/Contracts/IMessagingService.cs +++ b/EnvelopeGenerator.Application/Contracts/IMessagingService.cs @@ -2,6 +2,8 @@ { public interface IMessagingService { - public Task SendSmsAsync(string recipient, string message); + public Task SendSmsAsync(string recipient, string message); + + public Task SendSmsAsync(string recipient, string message); } } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/Services/GTXMessagingService.cs b/EnvelopeGenerator.Application/Services/GTXMessagingService.cs index 12208a6d..407d5908 100644 --- a/EnvelopeGenerator.Application/Services/GTXMessagingService.cs +++ b/EnvelopeGenerator.Application/Services/GTXMessagingService.cs @@ -1,4 +1,5 @@ using DigitalData.Core.Abstractions.Client; +using DigitalData.Core.Client; using EnvelopeGenerator.Application.Configurations.GtxMessaging; using EnvelopeGenerator.Application.Contracts; using Microsoft.Extensions.Options; @@ -17,12 +18,14 @@ namespace EnvelopeGenerator.Application.Services _smsParams = smsParamsOptions.Value; } - public async Task SendSmsAsync(string recipient, string message) + public Task SendSmsAsync(string recipient, string message) => SendSmsAsync(recipient: recipient, message: message); + + public async Task SendSmsAsync(string recipient, string message) { - await _smsClient.FetchAsync(queryParams: new Dictionary() { + return await _smsClient.FetchAsync(queryParams: new Dictionary() { { _smsParams.RecipientQueryParamName, recipient }, { _smsParams.MessageQueryParamName, message } - }); + }).ThenAsync(res => res.Json()); } } } \ No newline at end of file