Stuff happens. Nobody’s perfect.

But let’s be real clear: There’s no excuse — none — for a fast-food chain using a notorious Nazi episode as a promotion to “treat yourself.”

That, amazingly, is where KFC finds itself.

The fried-chicken heavyweight is apologizing for sending a mobile app alert to customers in Germany inviting them to partake of tasty food while commemorating Kristallnacht.

For those who may not know, Kristallnacht was an infamous act of violence against Jews in November 1938. It means “night of broken glass,” a reference to the many shop windows owned by Jews that were smashed by Nazi thugs.

Some historians say Kristallnacht marked the beginning of the Holocaust.

On Wednesday, KFC sent a notification to app users saying: “It’s memorial day for Kristallnacht! Treat yourself with more tender cheese on your crispy chicken. Now at KFCheese!”

The wrongness of this doesn’t need any help from me. It would be funny if it wasn’t so incredibly offensive and stupid.

KFC, owned by Yum Brands, said its Kristallnacht promotion contained “an obviously unplanned, insensitive and unacceptable message.”

“We understand and respect the gravity and history of this day, and remain committed to equity, inclusion and belonging for all,” the chain said in a statement.

All evidence to the contrary notwithstanding.

KFC blamed an automated system that links national observances to corporate promotions. It said internal review processes weren’t followed.

Again, stuff happens.

But there’s no excuse for this.

Businesses use automated systems to streamline operations and save money. But just because robots are on the payroll, that doesn’t absolve the company of responsibility for what the robots do.

As the saying goes, corporations are people — and people are ultimately responsible for all aspects of a business’ performance.

That something as insane as this could happen serves as a cautionary tale for all companies that (wrongly) think they can cut corners by letting algorithms do the heavy lifting.

Blindly trusting automation is a surefire road to glitches and embarrassment. If nothing else, the takeaway here is that nothing — nothing — should ever be communicated to customers without a human being having the final say.

It’s one thing to blandly declare that you’re “committed to equity, inclusion and belonging for all.”

It’s quite another to prove it.