}> */ public static function steps(string $sequence): array { $lib = [ // Dunning — comms alongside the RetryPolicy backoff charges. 'dunning' => [ ['offset_hours' => 0, 'action' => 'email', 'template' => 'dunning_1'], ['offset_hours' => 48, 'action' => 'email', 'template' => 'dunning_2'], ['offset_hours' => 120, 'action' => 'email', 'template' => 'dunning_final'], ], // Renewal reminder — a few days before the period ends. 'renewal_reminder' => [ ['offset_hours' => 0, 'action' => 'email', 'template' => 'renewal_reminder'], ], // Pre-cancel retention — pause / discount offer before a hard cancel. 'win_back_offer' => [ ['offset_hours' => 0, 'action' => 'pause_offer', 'template' => 'win_back_offer'], ], // Post-cancel win-back — reactivate, then a discount. 'win_back' => [ ['offset_hours' => 0, 'action' => 'email', 'template' => 'win_back_1'], ['offset_hours' => 168, 'action' => 'coupon_email', 'template' => 'win_back_coupon', 'meta' => ['percent' => 30, 'days_valid' => 14]], ], // Loyalty — subscription anniversary. 'loyalty' => [ ['offset_hours' => 0, 'action' => 'coupon_email', 'template' => 'loyalty', 'meta' => ['percent' => 15, 'days_valid' => 30]], ], ]; $steps = $lib[$sequence] ?? []; /** * @param array $steps * @param string $sequence */ return (array) apply_filters('abovault_sequence_steps', $steps, $sequence); } public static function count(string $sequence): int { return count(self::steps($sequence)); } }