0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-07-20 23:28:28 +02:00
This commit is contained in:
NorthRealm 2025-07-11 17:13:20 +08:00
parent 4f31cd88f7
commit 32ad9ba89c

View File

@ -149,14 +149,18 @@ func SendActionsWorkflowRunStatusEmail(ctx context.Context, sender *user_model.U
recipients := make([]*user_model.User, 0) recipients := make([]*user_model.User, 0)
if !sender.IsGiteaActions() && !sender.IsGhost() && sender.IsMailable() { if !sender.IsGiteaActions() && !sender.IsGhost() && sender.IsMailable() {
notifyPref, err := user_model.GetUserNotificationSettings(ctx, sender.ID)
if err != nil {
log.Error("GetUserNotificationSettings: %v", err)
return
}
if run.Status.IsSuccess() { if run.Status.IsSuccess() {
if sender.EmailNotificationsPreference == user_model.EmailNotificationsAndYourOwn { if notifyPref.Actions == user_model.NotificationGiteaActionsAll {
recipients = append(recipients, sender) recipients = append(recipients, sender)
} }
sendActionsWorkflowRunStatusEmail(ctx, repo, run, sender, recipients) sendActionsWorkflowRunStatusEmail(ctx, repo, run, sender, recipients)
return return
} else if sender.EmailNotificationsPreference != user_model.EmailNotificationsOnMention && } else if notifyPref.Actions != user_model.EmailNotificationsDisabled {
sender.EmailNotificationsPreference != user_model.EmailNotificationsDisabled {
recipients = append(recipients, sender) recipients = append(recipients, sender)
} }
} }