Sounds like the door interlock. Slamming the door might be enough to get it going but not always guaranteed to work and should only be used sparingly and not as permanent solution. Easy to replace if you are handy at all. They cost about £17. Switch off at mains, remove band round door gasket...