I've never invited an entire class to a party outside of school. I have brought in cupcakes to the school for the entire class; but for parties at our house (or at an outside venue, which I've only done twice), we've always invited only some kids, not all. But we mail or e-mail invitations, never send them in to the class. And I do teach the kids not to talk about their party at school.
Hope this helps.