Avoid emails if user status is OOO or post is an auto response (#8842)

This commit is contained in:
Chris Duarte
2018-05-28 10:49:28 -07:00
committed by Carlos Tadeu Panato Junior
parent c37d153ffb
commit 792dae23ca

View File

@@ -216,7 +216,9 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
}
}
if userAllowsEmails && status.Status != model.STATUS_ONLINE && profileMap[id].DeleteAt == 0 {
autoResponderRelated := status.Status == model.STATUS_OUT_OF_OFFICE || post.Type == model.POST_AUTO_RESPONDER
if userAllowsEmails && status.Status != model.STATUS_ONLINE && profileMap[id].DeleteAt == 0 && !autoResponderRelated {
a.sendNotificationEmail(post, profileMap[id], channel, team, channelName, senderName, sender)
}
}