Skip to content

Commit

Permalink
Merge pull request #15 from evrard-c/master
Browse files Browse the repository at this point in the history
Set default datacoding to "auto" and add a function to allow datacoding selection when sending messages
  • Loading branch information
petericebear committed Jun 6, 2018
2 parents e9f2bed + 5debc8f commit fa9df52
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/MessagebirdClient.php
Expand Up @@ -35,6 +35,9 @@ public function send(MessagebirdMessage $message)
if (empty($message->recipients)) {
$message->setRecipients(config('services.messagebird.recipients'));
}
if (empty($message->datacoding)) {
$message->setDatacoding('auto');
}

try {
$this->client->request('POST', 'https://rest.messagebird.com/messages', [
Expand Down
8 changes: 8 additions & 0 deletions src/MessagebirdMessage.php
Expand Up @@ -52,6 +52,14 @@ public function setReference($reference)

return $this;
}

public function setDatacoding($datacoding)
{
$this->datacoding = $datacoding;

return $this;
}


public function toJson()
{
Expand Down

0 comments on commit fa9df52

Please sign in to comment.