fix(events): point Messaging settings at suite defaults, not API keys
Deploy Ladill Events / deploy (push) Successful in 48s

Mirror Care: suite platform keys count as ready for attendee email/SMS;
Account Messaging is primary, product Bird/SMS keys are advanced.
SmsService now prefers channel=suite before customer API keys.
This commit is contained in:
isaacclad
2026-07-16 11:36:43 +00:00
parent 3d5ffa593d
commit a5ebd1e414
11 changed files with 127 additions and 16 deletions
+11 -4
View File
@@ -4,6 +4,8 @@ namespace App\Services\Events;
use App\Models\QrCode;
use App\Models\QrEventRegistration;
use App\Services\Billing\PlatformEmailClient;
use App\Services\Billing\PlatformSmsClient;
use App\Services\Billing\SmsService;
use App\Services\Messaging\MessagingCredentialsService;
use Illuminate\Support\Collection;
@@ -23,6 +25,8 @@ class EventCommsService
private readonly SmsService $sms,
private readonly MessagingCredentialsService $credentials,
private readonly EventProgrammeService $programmes,
private readonly PlatformEmailClient $platformEmail,
private readonly PlatformSmsClient $platformSms,
) {}
/** @return array{recipients: int, emails: int, sms: int, estimated_ghs: float, affordable: bool, integrations_error: ?string} */
@@ -188,12 +192,15 @@ class EventCommsService
$joinUrl,
) !== '';
if ($needsEmail && ! $credential->hasValidBird()) {
return 'Connect Ladill Bird in Integrations before sending attendee email.';
$emailReady = $this->platformEmail->isConfigured() || $credential->hasValidBird();
$smsReady = $this->platformSms->isConfigured() || $credential->hasValidSms();
if ($needsEmail && ! $emailReady) {
return 'Email is not available yet. Bind a mailbox under Account → Messaging once platform keys are configured, or connect Bird under Advanced keys.';
}
if ($needsSms && ! $credential->hasValidSms()) {
return 'Connect Ladill SMS in Integrations before sending attendee SMS.';
if ($needsSms && ! $smsReady) {
return 'SMS is not available yet. Ensure platform SMS is configured on this Events instance, or connect a product SMS key under Advanced keys.';
}
return null;