Skip to content

Commit 8d5a9f1

Browse files
authored
Optional sender check
1 parent db2b5a4 commit 8d5a9f1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Message.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,14 @@ public function setIsMarketing($isMarketing)
213213
* Set the sender of the message after checking it is a valid sender
214214
*
215215
* @param string $sender sender of the message
216+
* @param string $check check the sender and throw exception if not configured
216217
*
217218
* @return void
218219
* @throws \Ovh\Exceptions\InvalidParameterException if sender is invalid
219220
*/
220-
public function setSender($sender)
221+
public function setSender($sender, $check = true)
221222
{
222-
if (!$this->Sms->checkSender($sender)) {
223+
if ($check && !$this->Sms->checkSender($sender)) {
223224
throw new \Ovh\Exceptions\InvalidParameterException("Sender parameter is invalid");
224225
}
225226

0 commit comments

Comments
 (0)