There are parts of the world where that is illegal, yes.
See the "notice" section starting at bottom 3 of this for the lay persons summary on the notice requirement (or read the whole thing to see what laws around this look like in Germany) https://www.bakermckenzie.com/-/media/files/people/lutz-holg...