diff --git a/src/Command/WarrantySMSCommand.php b/src/Command/WarrantySMSCommand.php index 3e8591aa..8e0f9fc0 100644 --- a/src/Command/WarrantySMSCommand.php +++ b/src/Command/WarrantySMSCommand.php @@ -45,7 +45,26 @@ class WarrantySMSCommand extends Command foreach ($warrs as $w) { - error_log($w->getID()); + error_log($w->getID() . ' - ' . $w->getMobileNumber()); + // check valid number + $num = trim($w->getMobileNumber()); + + // should start with '9' + if ($num[0] != '9') + continue; + + // should be 10 digits + if (strlen($num) != 10) + continue; + + // should be numeric + if (!is_numeric($num)) + continue; + + error_log('valid!'); + + // add 63 prefix + $num = '63' . $num; } /*