Depends where it's snapped
There's a lead coming from the car, which has a connector on. This joins to another wire with another connector on which comes off the brake pad.
On my car they've been cut at some point and someone put female spade ends on the car side. When i get new pads i just snip off the bulky connector and pop two male spade ends on.
Depending where it's snapped, you could do the same if you didn't want to replace the proper lead if its broken on the car side.