Files
components/LiteCharms.Features/Email/Events/Handlers/SendShopEmailEnquiryEventHandler.cs
T
Khwezi Mngoma cecd9f90e9
continuous-integration/drone/pr Build is passing
Implemented service bus handling of emails and notification processing
2026-05-10 16:50:36 +02:00

19 lines
891 B
C#

using LiteCharms.Features.Notifications.Commands;
using static LiteCharms.Abstractions.Constants;
namespace LiteCharms.Features.Email.Events.Handlers;
public class SendShopEmailEnquiryEventHandler(ISender mediator) :
INotificationHandler<SendShopEmailEnquiryEvent>
{
public async ValueTask Handle(SendShopEmailEnquiryEvent notification, CancellationToken cancellationToken)
{
var command = CreateNotificationCommand.Create(Models.NotificationDirection.Outgoing, notification.SenderName!,
notification.SenderAddress!, notification.Subject!, notification.Message!, Models.NotificationPlatforms.Email,
notification.Priority, ShopEmailFromName, ShopEmailFromAddress, Guid.CreateVersion7().ToString(),
Models.CorrelationIdTypes.None, isInternal: true, isHtml: false);
await mediator.Send(command, cancellationToken);
}
}