Either can be done but just pouring heated water into the cooler is probably done by 98% of us. Adding an electric heating element to a cooler is cool, but much more expensive and you need the right know-how (wouldn't want to melt the cooler, would you?).
Edit: by pouring, I mean use a ball valve on your kettle. Pouring gallons of hot water might not be a great idea.