[GH-7260] Add check for verified email when required by server settings (#7275)

* Add check for verified email when required by server settings

* remove debug and simplify logic with continue
This commit is contained in:
Alex Moon
2017-09-06 13:43:48 -07:00
committed by Harrison Healey
parent cb266eb942
commit 06a959e19e

View File

@@ -158,6 +158,12 @@ func SendNotifications(post *model.Post, team *model.Team, channel *model.Channe
}
}
//If email verification is required and user email is not verified don't send email.
if utils.Cfg.EmailSettings.RequireEmailVerification && !profileMap[id].EmailVerified {
l4g.Error("Skipped sending notification email to %v, address not verified. [details: user_id=%v]", profileMap[id].Email, id)
continue
}
var status *model.Status
var err *model.AppError
if status, err = GetStatus(id); err != nil {