Skip to content

Commit

Permalink
Update CommentReplyNotification.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
EdiWang committed Jan 21, 2024
1 parent 58bacec commit 27122dd
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/Moonglade.Email.Client/CommentReplyNotification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,11 @@ public record CommentReplyNotification(
string ReplyContentHtml,
string PostLink) : INotification;

internal record CommentReplyPayload(
string CommentContent,
string Title,
string ReplyContentHtml,
string PostLink);

public class CommentReplyNotificationHandler(IMoongladeEmailClient moongladeEmailClient) : INotificationHandler<CommentReplyNotification>
{
public async Task Handle(CommentReplyNotification notification, CancellationToken ct)
{
var payload = new CommentReplyPayload(
notification.CommentContent,
notification.Title,
notification.ReplyContentHtml,
notification.PostLink);

var dl = new[] { notification.Email };
await moongladeEmailClient.SendEmail(MailMesageTypes.AdminReplyNotification, dl, payload);
await moongladeEmailClient.SendEmail(MailMesageTypes.AdminReplyNotification, dl, notification);
}
}

0 comments on commit 27122dd

Please sign in to comment.