$message, 'PhoneNumber' => $number, ]; include_once __DIR__ . '/../../3rdParty/composer/autoload.php'; $clientOptions = [ 'version' => '2010-03-31', 'region' => $region, 'credentials' => [ 'key' => $accountId, 'secret' => $apiToken, ], ]; $snsClient = new SnsClient($clientOptions); try { $result = $snsClient->publish($options); logNewMessage(LOG_DEBUG, 'SMS sending response: ' . print_r($result, true)); } catch (AwsException $e) { logNewMessage(LOG_ERR, 'Unable to send SMS to ' . $number . ': ' . $e->getMessage()); throw new LAMException(null, $e->getMessage(), $e); } } /** * @inheritDoc */ public function usesApiToken(): bool { return true; } /** * @inheritDoc */ public function usesApiKey(): bool { return false; } /** * @inheritDoc */ public function usesAccountId(): bool { return true; } /** * @inheritDoc */ public function usesFrom(): bool { return false; } /** * @inheritDoc */ public function usesRegion(): bool { return true; } /** * @inheritDoc */ public function usesSubject(): bool { return false; } }