19 lines
891 B
C#
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);
|
|
}
|
|
}
|