From d8b39324d71112f0d8c2e38b2aa92fdccec536ef Mon Sep 17 00:00:00 2001
From: sebastian-sauer <sauer.sebastian@gmail.com>
Date: Wed, 13 Sep 2023 22:32:58 +0200
Subject: [PATCH] Load reviewer before sending notification (#27063) (#27064)

Fixes #27035
---
 modules/notification/mail/mail.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/notification/mail/mail.go b/modules/notification/mail/mail.go
index a5fed51ebd..7c91cdd0c7 100644
--- a/modules/notification/mail/mail.go
+++ b/modules/notification/mail/mail.go
@@ -177,6 +177,9 @@ func (m *mailNotifier) NotifyPullRequestPushCommits(ctx context.Context, doer *u
 }
 
 func (m *mailNotifier) NotifyPullReviewDismiss(ctx context.Context, doer *user_model.User, review *issues_model.Review, comment *issues_model.Comment) {
+	if err := comment.Review.LoadReviewer(ctx); err != nil {
+		log.Error("Error in PullReviewDismiss while loading reviewer for issue[%d], review[%d] and reviewer[%d]: %v", review.Issue.ID, comment.Review.ID, comment.Review.ReviewerID, err)
+	}
 	if err := mailer.MailParticipantsComment(ctx, comment, activities_model.ActionPullReviewDismissed, review.Issue, nil); err != nil {
 		log.Error("MailParticipantsComment: %v", err)
 	}