1 | <?php |
||
10 | class SendHttpApiParams implements HttpApiParams |
||
11 | { |
||
12 | /** |
||
13 | * @var EngageSpark |
||
14 | */ |
||
15 | protected $service; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $mobile; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $message; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $senderId; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $recipientType = 'mobile_number'; |
||
36 | |||
37 | /** |
||
38 | * SendParams constructor. |
||
39 | * @param $service |
||
40 | * @param $mobile |
||
41 | * @param $message |
||
42 | */ |
||
43 | public function __construct(EngageSpark $service, string $mobile, string $message, string $senderId = null) |
||
44 | { |
||
45 | $this->service = $service; |
||
46 | $this->mobile = $mobile; |
||
47 | $this->message = $message; |
||
48 | $this->setSenderId($service, $senderId); |
||
49 | } |
||
50 | |||
51 | public function toArray(): array |
||
52 | { |
||
53 | return [ |
||
54 | 'orgId' => $this->service->getOrgId(), |
||
55 | 'to' => $this->getFormattedMobile(), |
||
56 | 'from' => $this->senderId, |
||
57 | 'message' => $this->message, |
||
58 | ]; |
||
59 | } |
||
60 | |||
61 | protected function setSenderId(EngageSpark $service, string $senderId = null) |
||
67 | |||
68 | protected function getFormattedMobile() |
||
69 | { |
||
74 | } |
||
75 |