first commit
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
using System.Threading.Tasks;
|
||||
using LCU.Library.Internal.NotificationsModels.Models;
|
||||
|
||||
namespace Landmark.OLA.Application.Services.MicroApiServices
|
||||
{
|
||||
public interface INotificationsApiService
|
||||
{
|
||||
Task SendEmailAsync(EmailRequest request);
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
using Serilog;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Landmark.OLA.Application.DataAccess;
|
||||
using LCU.Library.Internal.NotificationsModels.Models;
|
||||
|
||||
namespace Landmark.OLA.Application.Services.MicroApiServices
|
||||
{
|
||||
public class NotificationsApiService : INotificationsApiService
|
||||
{
|
||||
private readonly INotificationDao _notificationsApiDao;
|
||||
|
||||
public NotificationsApiService(INotificationDao notificationsApiDao)
|
||||
{
|
||||
_notificationsApiDao = notificationsApiDao;
|
||||
}
|
||||
|
||||
public async Task SendEmailAsync(EmailRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
await _notificationsApiDao.SendEmailAsync(request);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
var error = $"Failure during SendEmailAsync. Exception Message: {exception.Message}";
|
||||
Log.Error(error);
|
||||
throw new Exception(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user