Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,9 @@ protected function doSend(MessageInterface $message): SentMessage

return new SentMessage($message, (string) $this);
}

protected function getEndpoint(): ?string
{
return $this->host.($this->port ? ':'.$this->port : '');
}
}
6 changes: 3 additions & 3 deletions src/Symfony/Component/Notifier/Bridge/Infobip/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Infobip Notifier
================

Provides Infobip integration for Symfony Notifier.
Provides [Infobip](https://infobip.com) integration for Symfony Notifier.

DSN example
-----------

```
INFOBIP_DSN=infobip://AUTH_TOKEN@INFOBIP_HOST?from=FROM
INFOBIP_DSN=infobip://AUTH_TOKEN@HOST?from=FROM
```

where:
- `AUTH_TOKEN` is your Infobip auth token
- `INFOBIP_HOST` is your Infobip host
- `HOST` is your Infobip host
- `FROM` is the sender

Resources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,14 @@ protected function doSend(MessageInterface $message): SentMessage

$success = $response->toArray(false);

$sentMessage = new SentMessage($sentMessage, (string) $this);
$sentMessage = new SentMessage($message, (string) $this);
$sentMessage->setMessageId($success['id']);

return $sentMessage;
}

protected function getEndpoint(): ?string
{
return $this->host.($this->port ? ':'.$this->port : '');
}
}
3 changes: 2 additions & 1 deletion src/Symfony/Component/Notifier/Bridge/Zulip/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ DSN example
-----------

```
ZULIP_DSN=zulip://EMAIL:TOKEN@default?channel=CHANNEL
ZULIP_DSN=zulip://EMAIL:TOKEN@HOST?channel=CHANNEL
```

where:
- `EMAIL` is your Zulip email
- `TOKEN` is your Zulip token
- `HOST` is your Zulip host
- `CHANNEL` is the channel

Resources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ protected function doSend(MessageInterface $message): SentMessage
throw new LogicException(sprintf('The "%s" transport only supports instances of "%s" for options.', __CLASS__, ZulipOptions::class));
}

$endpoint = sprintf('https://%s/api/v1/messages', $this->getEndpoint());

$options = ($opts = $message->getOptions()) ? $opts->toArray() : [];
$options['content'] = $message->getSubject();

Expand All @@ -80,6 +78,8 @@ protected function doSend(MessageInterface $message): SentMessage
$options['to'] = $message->getRecipientId();
}

$endpoint = sprintf('https://%s/api/v1/messages', $this->getEndpoint());

$response = $this->client->request('POST', $endpoint, [
'auth_basic' => $this->email.':'.$this->token,
'body' => $options,
Expand Down