Trieda `BulkGate\Sdk\Message\Sms` reprezentuje objekt SMS správy, ktorá sa skladá z obsahu správy a príjemcu.

```php
use BulkGate\Sdk\Message\Sms;
use BulkGate\Sdk\Message\Component\{PhoneNumber, SimpleText}
```

## Príjemca

Trieda prijíma ako prvý argument telefónne číslo, ktoré môže byť zadané reťazcom:

```php
$message = new Sms('420777777777', 'test message');
```

alebo prijíma inštanciu objektu `BulkGate\Sdk\Message\Component\PhoneNumber`:

```php
$message = new Sms(new PhoneNumber('777777777', 'cz'), 'test message');
```

Na získanie telefónneho čísla môžete použiť výpis objektu triedy `BulkGate\Sdk\Message\Component\PhoneNumber`, ktorý vždy vracia telefónne číslo ako reťazec.

Telefónne číslo a ISO môžete nastaviť aj samostatne.

```php
$phone_number = new PhoneNumber();
$phone_number->phoneNumber('777777777');
$phone_number->iso('cz');       
```

## Text správy

Druhým parametrom je zadanie textu správy. Aj tu existujú 2 možnosti: prvou je zadanie textu pomocou `reťazca` a druhou inštancia triedy `SimpleText` alebo `null`.

```php
$phone_number = new PhoneNumber('777777777', 'cz');
$text = new SimpleText('test <variable>', ['variable' => 'message']);
$message = new Sms($phone_number, $text);
```

Samozrejme aj tu môžete definovať text až po vytvorení inštancie objektu pomocou metódy `text(string $text, array $variables = [])`

```php
$phone_number = new PhoneNumber('777777777', 'cz');
$message = new Sms($phone_number);
$message->text('test <variable>', ['variable' => 'message'])
```

## Nastavenie

V nastavení verejnej premennej môžete konfigurovať [sender_id](https://www.bulkgate.com/sk/dokumentacia/advanced-api/advanced-transactional/2.0/) a Unicode.

```php
$sender_id = 'gText';
$sender_id_value = 'Test sender';
$unicode = false;
$message->settings->configure($sender_id, $sender_id_value, $unicode);
```