Skip to content

Getting coupon codes from sales rule?

Magento 2.4.6

I creates a sales rule, lets say it has ID 123. I am loading it like this for now (yes, I know ObjectManager is bad practice):

$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$rule = $objectManager->create('MagentoSalesRuleModelRule')->load(123);

Now, how do I get the automatically created coupons in that sales rule?