[Notifier] [Infobip][Zulip] Host is required
This commit is contained in:
parent
9e87661911
commit
cfd932e036
@ -86,4 +86,9 @@ final class InfobipTransport extends AbstractTransport
|
|||||||
|
|
||||||
return new SentMessage($message, (string) $this);
|
return new SentMessage($message, (string) $this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getEndpoint(): ?string
|
||||||
|
{
|
||||||
|
return $this->host.($this->port ? ':'.$this->port : '');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
Infobip Notifier
|
Infobip Notifier
|
||||||
================
|
================
|
||||||
|
|
||||||
Provides Infobip integration for Symfony Notifier.
|
Provides [Infobip](https://infobip.com) integration for Symfony Notifier.
|
||||||
|
|
||||||
DSN example
|
DSN example
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
```
|
```
|
||||||
INFOBIP_DSN=infobip://AUTH_TOKEN@INFOBIP_HOST?from=FROM
|
INFOBIP_DSN=infobip://AUTH_TOKEN@HOST?from=FROM
|
||||||
```
|
```
|
||||||
|
|
||||||
where:
|
where:
|
||||||
- `AUTH_TOKEN` is your Infobip auth token
|
- `AUTH_TOKEN` is your Infobip auth token
|
||||||
- `INFOBIP_HOST` is your Infobip host
|
- `HOST` is your Infobip host
|
||||||
- `FROM` is the sender
|
- `FROM` is the sender
|
||||||
|
|
||||||
Resources
|
Resources
|
||||||
|
@ -78,9 +78,14 @@ final class MattermostTransport extends AbstractTransport
|
|||||||
|
|
||||||
$success = $response->toArray(false);
|
$success = $response->toArray(false);
|
||||||
|
|
||||||
$sentMessage = new SentMessage($sentMessage, (string) $this);
|
$sentMessage = new SentMessage($message, (string) $this);
|
||||||
$sentMessage->setMessageId($success['id']);
|
$sentMessage->setMessageId($success['id']);
|
||||||
|
|
||||||
return $sentMessage;
|
return $sentMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getEndpoint(): ?string
|
||||||
|
{
|
||||||
|
return $this->host.($this->port ? ':'.$this->port : '');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,12 +7,13 @@ DSN example
|
|||||||
-----------
|
-----------
|
||||||
|
|
||||||
```
|
```
|
||||||
ZULIP_DSN=zulip://EMAIL:TOKEN@default?channel=CHANNEL
|
ZULIP_DSN=zulip://EMAIL:TOKEN@HOST?channel=CHANNEL
|
||||||
```
|
```
|
||||||
|
|
||||||
where:
|
where:
|
||||||
- `EMAIL` is your Zulip email
|
- `EMAIL` is your Zulip email
|
||||||
- `TOKEN` is your Zulip token
|
- `TOKEN` is your Zulip token
|
||||||
|
- `HOST` is your Zulip host
|
||||||
- `CHANNEL` is the channel
|
- `CHANNEL` is the channel
|
||||||
|
|
||||||
Resources
|
Resources
|
||||||
|
@ -63,8 +63,6 @@ class ZulipTransport extends AbstractTransport
|
|||||||
throw new LogicException(sprintf('The "%s" transport only supports instances of "%s" for options.', __CLASS__, ZulipOptions::class));
|
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 = ($opts = $message->getOptions()) ? $opts->toArray() : [];
|
||||||
$options['content'] = $message->getSubject();
|
$options['content'] = $message->getSubject();
|
||||||
|
|
||||||
@ -80,6 +78,8 @@ class ZulipTransport extends AbstractTransport
|
|||||||
$options['to'] = $message->getRecipientId();
|
$options['to'] = $message->getRecipientId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$endpoint = sprintf('https://%s/api/v1/messages', $this->getEndpoint());
|
||||||
|
|
||||||
$response = $this->client->request('POST', $endpoint, [
|
$response = $this->client->request('POST', $endpoint, [
|
||||||
'auth_basic' => $this->email.':'.$this->token,
|
'auth_basic' => $this->email.':'.$this->token,
|
||||||
'body' => $options,
|
'body' => $options,
|
||||||
|
Reference in New Issue
Block a user