Before an action for a penalty is commenced under authority of section 29:3-17 of this title at least ten days’ notice thereof shall be given to the alleged violator. If, before the expiration of such time, the alleged violator ceases his violation he shall not be liable to the penalty.