lastError; } public function isConfiguredForOwner(string $ownerPublicId): bool { return $this->credentials->forOwner($ownerPublicId)->hasValidBird(); } /** @deprecated Use isConfiguredForOwner() — attendee email requires per-account Bird credentials. */ public function isConfigured(): bool { return false; } public function send( string $ownerPublicId, string $to, string $subject, string $html, ?string $text = null, ?string $replyToEmail = null, ?string $replyToName = null, ): bool { $this->lastError = null; $credential = $this->credentials->forOwner($ownerPublicId); if (! $credential->hasValidBird()) { $this->lastError = 'Connect Ladill Bird in Integrations before sending attendee email.'; return false; } $apiKey = $credential->birdApiKey(); if (! $apiKey) { $this->lastError = 'Bird credentials could not be decrypted. Reconnect Bird in Integrations.'; return false; } $sent = $this->customerEmail->send( $apiKey, (string) $credential->bird_from_email, $credential->bird_from_name, $to, $subject, $html, $text, ); if (! $sent) { $this->lastError = $this->customerEmail->lastError() ?: 'The email could not be sent.'; return false; } return true; } }