29 lines
818 B
C#

using DigitalData.Core.Abstractions.Client;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.Configurations.GtxMessaging;
using Microsoft.Extensions.Options;
namespace EnvelopeGenerator.Application.Services
{
public class GtxMessagingService
{
private readonly SmsParams _smsParams;
private readonly IHttpClientService<SmsParams> _smsClient;
private readonly string _authPath;
public GtxMessagingService(IOptions<SmsParams> smsParamsOptions, IHttpClientService<SmsParams> smsClient)
{
_smsParams = smsParamsOptions.Value;
_smsClient = smsClient;
_authPath = _smsParams.AuthPath;
}
public async Task SendSms()
{
await _smsClient.FetchAsync(path: _authPath);
}
}
}