I have all notifications (that I want on) set to on. I have placed yahoo email app and Gmail for Unrestricted battery usage.
But doesn't matter because phone goes into doze mode and I don't get the notifications, at least not for sometimes 10 minutes, 20 minutes after an email arrives. In many cases I wouldn't care, but if there is movement in front of my security camera, I want to be alerted asap, not 25 minutes after lol.
This is a widely experienced thing I'm reading online with doze mode. charging the phone turns doze mode off, and I get all my notifications in a timely manner while plugged in. Also, there are some work-arounds with forcing doze mode off, but it if you restart your phone, it re initiates I guess.