To attach rare earth magnets; first sand the magnet with 80 grit just until you see the copper layer under the nickel plating. This creates some grooves for the epoxy to bond to. Wood has enough natural grooves that is doesn't need to be roughed up. Then use a slow setting, two part epoxy. If you have enough thickness drill a small recess the diameter of the magnet to keep it located. Mix the epoxy thoroughly, put some on the magnet and press gently into place.
Slow setting epoxy takes hours to get to the gel stage before the magnet doesn't move around so you need to make sure the area is level or you've taped the magnets securely. Don't clamp them as you don't want to squeeze the epoxy out of the joint. Epoxy needs to be in the joint to work properly, unlike wood glue which moves into the wood. Leave them to cure for 24 hours and then it will have reached most of its strength.
Slow setting epoxy takes hours to get to the gel stage before the magnet doesn't move around so you need to make sure the area is level or you've taped the magnets securely. Don't clamp them as you don't want to squeeze the epoxy out of the joint. Epoxy needs to be in the joint to work properly, unlike wood glue which moves into the wood. Leave them to cure for 24 hours and then it will have reached most of its strength.