public CreateNotificationCommand(NotificationCorrelationId notificationCorrelationId, Username username, NotificationTitle notificationTitle, NotificationContent notificationContent, DateTime operationDate) { NotificationCorrelationId = notificationCorrelationId; Username = username; NotificationTitle = notificationTitle; NotificationContent = notificationContent; OperationDate = operationDate; }
public Notification(NotificationCorrelationId correlationId, Username username, NotificationTitle title, NotificationContent content, bool isSeen, DateTime operationDate, DateTime createdOn) { CorrelationId = correlationId; Username = username; Title = title; Content = content; IsSeen = isSeen; OperationDate = operationDate; CreatedOn = createdOn; }
public async Task Consume(ConsumeContext <OrderShippedEvent> context) { OrderShippedEvent orderShippedEvent = context.Message; NotificationCorrelationId notificationCorrelationId = new NotificationCorrelationId($"{orderShippedEvent.Username}-{orderShippedEvent.OrderId}-{orderShippedEvent.ShipmentId}"); Username username = new Username(orderShippedEvent.Username); NotificationTitle notificationTitle = new NotificationTitle($"Order Shipped"); NotificationContent notificationContent = new NotificationContent($"#{orderShippedEvent.OrderId} order is shipped at {orderShippedEvent.ShipmentDate}"); CreateNotificationCommand createNotificationCommand = new CreateNotificationCommand(notificationCorrelationId, username, notificationTitle, notificationContent, orderShippedEvent.ShipmentDate); await SendCreateNotificationCommandAsync(createNotificationCommand); }
public MailObject WriteToMailObject(MailObject message) { var contactSettings = Engine.Settings.Contact; message.PreHeader = NotificationTitle.IsSet() ? NotificationTitle.ReplaceSiteVariables() : contactSettings.Title.ReplaceSiteVariables(); message.Subject = NotificationSubject.IsSet() ? NotificationSubject.ReplaceSiteVariables() : contactSettings.Subject.ReplaceSiteVariables(); message.AddParagraph(NotificationMessage.IsSet() ? NotificationMessage.ReplaceSiteVariables() : contactSettings.Message.ReplaceSiteVariables()); message.AddParagraph("Name: <strong>" + Name + "</strong>"); message.AddParagraph("Email: <strong>" + Email + "</strong>"); message.AddParagraph("Phone: <strong>" + PhoneNumber + "</strong>"); message.AddParagraph("Subject: <strong>" + Subject + "</strong>"); message.AddParagraph("Enquiry:"); message.AddParagraph("<strong>" + Enquiry + "</strong>"); return(message); }
public Notification(NotificationCorrelationId correlationId, Username username, NotificationTitle title, NotificationContent content, DateTime operationDate) : this(correlationId, username, title, content, false, operationDate, DateTime.UtcNow) { }