Files
components/LiteCharms.Features.TechShop/Notifications/Events/Handlers/SendShopEmailEnquiryEventHandler.cs
T
Khwezi Mngoma 70c6e0bfbc
continuous-integration/drone/pr Build is passing
Split Features to create space for more projects
2026-05-24 13:19:09 +02:00

26 lines
1.1 KiB
C#

using static LiteCharms.Features.Extensions.Email;
namespace LiteCharms.Features.TechShop.Notifications.Events.Handlers;
public class SendShopEmailEnquiryEventHandler(NotificationService notificationService) :
INotificationHandler<SendShopEmailEnquiryEvent>
{
public async ValueTask Handle(SendShopEmailEnquiryEvent notification, CancellationToken cancellationToken) =>
await notificationService.CreateNotificationAsync(new Models.CreateNotification
{
CorrelationId = notification.CorrelationId,
CorrelationIdType = CorrelationIdTypes.None,
Direction = NotificationDirection.Outgoing,
IsHtml = false,
IsInternal = true,
Message = notification.Message,
Platform = NotificationPlatforms.Email,
Priority = notification.Priority,
Subject = notification.Subject!,
Sender = notification.SenderName!,
SenderAddress = notification.SenderAddress!,
Recipient = ShopEmailFromName,
RecipientAddress = ShopEmailFromAddress
}, cancellationToken);
}