Files
ladill-events/app/Services/Billing/SmsService.php
T
isaaccladandCursor 06fedcfc55
Deploy Ladill Events / deploy (push) Successful in 41s
Add virtual event sessions with Meet sync and platform-billed messaging.
Events can define hybrid/virtual sessions synced to Meet rooms; SMS and email use wallet-billed platform APIs instead of Termii and Laravel mail.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 22:08:09 +00:00

25 lines
595 B
PHP

<?php
namespace App\Services\Billing;
class SmsService
{
public function __construct(private readonly PlatformSmsClient $platform) {}
public function send(string $ownerPublicId, string $to, string $message): void
{
$phone = preg_replace('/\D+/', '', $to);
if (strlen($phone) < 9) {
return;
}
if (strlen($phone) === 9) {
$phone = '233'.$phone;
} elseif (str_starts_with($phone, '0')) {
$phone = '233'.substr($phone, 1);
}
$this->platform->send($ownerPublicId, $phone, $message);
}
}