I've been on here before asking about writing code to get Magento to generate a random coupon code for a new e-mail subscriber - Creating a single random Magento coupon
This code worked perfectly and to those who helped I am eternally grateful. I am now looking for a way to delete these coupons as they expire in a bulk fashion because deleting them individually through the Magento admin is a huge pain. As you can see from the picture below, in the span of a couple of days we generated over 300 coupons (all now expired).
Would modifying the create coupon code detailed in the link (from my original question) above work? Something like:
$model = Mage::getModel('salesrule/rule')
$model->getName('New newsletter subscriber discount');
$model->getToDate(date('Y-m-d'));
$model->delete();
Or am I totally barking up the wrong tree here?