Solder the magnet to a piece of ferrous metal, a washer maybe, then just stick the magnet to it?
I have a bunch of these from a project that fell through, a #4 screw can go through the middle, be epoxied on the other side, then the wire soldered to the screw.
https://www.kjmagnetics.com/proddetail.asp?prod=RC24DCS&cat=173