41 lines
1.4 KiB
C#
41 lines
1.4 KiB
C#
using LiteCharms.Features.Abstractions;
|
|
using LiteCharms.Features.Shop;
|
|
|
|
namespace LiteCharms.Features.Email.Events;
|
|
|
|
public class SendShopEmailEnquiryEvent : EventBase, IEvent
|
|
{
|
|
public string Name { get; set; } = nameof(SendShopEmailEnquiryEvent);
|
|
|
|
public string? SenderName { get; set; }
|
|
|
|
public string? SenderAddress { get; set; }
|
|
|
|
public string? Subject { get; set; }
|
|
|
|
public string? Message { get; set; }
|
|
|
|
public Priorities Priority { get; set; }
|
|
|
|
public SendShopEmailEnquiryEvent() { }
|
|
|
|
private SendShopEmailEnquiryEvent(string senderName, string senderAddress, string subject, string message, Priorities priority = Priorities.Medium)
|
|
{
|
|
SenderName = senderName;
|
|
SenderAddress = senderAddress;
|
|
Subject = subject;
|
|
Message = message;
|
|
Priority = priority;
|
|
}
|
|
|
|
public static SendShopEmailEnquiryEvent Create(string senderName, string senderAddress, string subject, string message, Priorities priority = Priorities.Medium)
|
|
{
|
|
ArgumentNullException.ThrowIfNullOrWhiteSpace(senderName, nameof(senderName));
|
|
ArgumentNullException.ThrowIfNullOrWhiteSpace(senderAddress, nameof(senderAddress));
|
|
ArgumentNullException.ThrowIfNullOrWhiteSpace(subject, nameof(subject));
|
|
ArgumentNullException.ThrowIfNullOrWhiteSpace(message, nameof(message));
|
|
|
|
return new(senderName, senderAddress, subject, message, priority);
|
|
}
|
|
}
|