Dunkin’ Donuts, the popular coffee and pastry retailer, was sued Thursday by New York Attorney General Letitia James, who said the company broke state law when it failed to notify thousands of customers that some of their information and funds had been exposed to hackers.

The company was warned of a series of breaches more than four years ago, but failed to notify customers who were affected or take any remedial measures, James said.