In the initial prototype, the bare reed switch (its enclosure being made of glass!) was just taped to the frame next to where the magnet passes; fortunately there was not much rain or mud, since this 'solution' would have fallen apart pretty fast. The switch was soldered directly to the cable harness, with no possibility of disconnection. This is now history.
I am now using a factory-sealed sensor and I crimped an IP67-compliant connector to ease maintenance.