getEndpoint example

final class PagerDutyTransport extends AbstractTransport
{
    protected const HOST = 'events.pagerduty.com';

    public function __construct(#[\SensitiveParameter] private readonly string $token, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)     {
        parent::__construct($client$dispatcher);
    }

    public function __toString(): string
    {
        return sprintf('pagerduty://%s', $this->getEndpoint());
    }

    public function supports(MessageInterface $message): bool
    {
        return $message instanceof PushMessage && (null === $message->getOptions() || $message->getOptions() instanceof PagerDutyOptions);
    }

    protected function doSend(MessageInterface $message = null): SentMessage
    {
        if (!$message instanceof PushMessage) {
            throw new UnsupportedMessageTypeException(__CLASS__, PushMessage::class$message);
        }
public function __construct(string $username, #[\SensitiveParameter] string $password, string $sender, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)     {
        $this->username = $username;
        $this->password = $password;
        $this->sender = $sender;

        parent::__construct($client$dispatcher);
    }

    public function __toString(): string
    {
        return sprintf('kaz-info-teh://%s?sender=%s', $this->getEndpoint()$this->sender);
    }

    public function supports(MessageInterface $message): bool
    {
        return $message instanceof SmsMessage
            && str_starts_with($message->getPhone(), '77')
            && 11 === \strlen($message->getPhone())
        ;
    }

    protected function doSend(MessageInterface $message): SentMessage
    {
public function __construct(#[\SensitiveParameter] string $authToken, string $from, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)     {
        $this->authToken = $authToken;
        $this->from = $from;

        parent::__construct($client$dispatcher);
    }

    public function __toString(): string
    {
        return sprintf('mailjet://%s@%s', $this->from, $this->getEndpoint());
    }

    public function supports(MessageInterface $message): bool
    {
        return $message instanceof SmsMessage;
    }

    protected function doSend(MessageInterface $message): SentMessage
    {
        if (!$message instanceof SmsMessage) {
            throw new UnsupportedMessageTypeException(__CLASS__, SmsMessage::class$message);
        }
public function __construct(MailerInterface $mailer, string $to, string $from, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
    {
        $this->mailer = $mailer;
        $this->to = $to;
        $this->from = $from;

        parent::__construct($client$dispatcher);
    }

    public function __toString(): string
    {
        return sprintf('fakesms+email://%s?to=%s&from=%s', $this->getEndpoint()$this->to, $this->from);
    }

    public function supports(MessageInterface $message): bool
    {
        return $message instanceof SmsMessage;
    }

    /** * @param MessageInterface|SmsMessage $message * * @throws TransportExceptionInterface */
public function __construct(string $accountSid, #[\SensitiveParameter] string $authToken, string $from, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)     {
        $this->accountSid = $accountSid;
        $this->authToken = $authToken;
        $this->from = $from;

        parent::__construct($client$dispatcher);
    }

    public function __toString(): string
    {
        return sprintf('twilio://%s?from=%s', $this->getEndpoint()$this->from);
    }

    public function supports(MessageInterface $message): bool
    {
        return $message instanceof SmsMessage && (null === $message->getOptions() || $message->getOptions() instanceof TwilioOptions);
    }

    protected function doSend(MessageInterface $message): SentMessage
    {
        if (!$message instanceof SmsMessage) {
            throw new UnsupportedMessageTypeException(__CLASS__, SmsMessage::class$message);
        }
$this->client = $client;

        parent::__construct($client$dispatcher);
    }

    public function __toString(): string
    {
        $query = array_filter([
            'channel' => $this->chatChannel,
        ]);

        return sprintf('slack://%s%s', $this->getEndpoint()$query ? '?'.http_build_query($query, '', '&') : '');
    }

    public function supports(MessageInterface $message): bool
    {
        return $message instanceof ChatMessage && (null === $message->getOptions() || $message->getOptions() instanceof SlackOptions);
    }

    /** * @see https://api.slack.com/methods/chat.postMessage */
    protected function doSend(MessageInterface $message): SlackSentMessage
    {
    {
        $this->username = $username;
        $this->password = $password;
        $this->authKey = $authKey;
        $this->from = $from;

        parent::__construct($client$dispatcher);
    }

    public function __toString(): string
    {
        return sprintf('sendberry://%s?from=%s', $this->getEndpoint()$this->from);
    }

    public function supports(MessageInterface $message): bool
    {
        return $message instanceof SmsMessage;
    }

    protected function doSend(MessageInterface $message): SentMessage
    {
        if (!$message instanceof SmsMessage) {
            throw new UnsupportedMessageTypeException(__CLASS__, SmsMessage::class$message);
        }
public function __construct(#[\SensitiveParameter] string $accessToken, string $chatChannel = null, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)     {
        $this->accessToken = $accessToken;
        $this->chatChannel = $chatChannel;
        $this->client = $client;

        parent::__construct($client$dispatcher);
    }

    public function __toString(): string
    {
        return sprintf('rocketchat://%s%s', $this->getEndpoint(), null !== $this->chatChannel ? '?channel='.$this->chatChannel : '');
    }

    public function supports(MessageInterface $message): bool
    {
        return $message instanceof ChatMessage && (null === $message->getOptions() || $message->getOptions() instanceof RocketChatOptions);
    }

    /** * @see https://rocket.chat/docs/administrator-guides/integrations */
    protected function doSend(MessageInterface $message): SentMessage
    {
public function __construct(#[\SensitiveParameter] string $token = null, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)     {
        $this->token = $token;
        $this->client = $client;

        parent::__construct($client$dispatcher);
    }

    public function __toString(): string
    {
        return sprintf('expo://%s', $this->getEndpoint());
    }

    public function supports(MessageInterface $message): bool
    {
        return $message instanceof PushMessage;
    }

    /** * @see https://docs.expo.dev/push-notifications/sending-notifications/#http2-api */
    protected function doSend(MessageInterface $message): SentMessage
    {
    {
        $this->userLogin = $userLogin;
        $this->apiKey = $apiKey;
        $this->from = $from;
        $this->type = $type;

        parent::__construct($client$dispatcher);
    }

    public function __toString(): string
    {
        return sprintf('octopush://%s?from=%s&type=%s', $this->getEndpoint()$this->from, $this->type);
    }

    public function supports(MessageInterface $message): bool
    {
        return $message instanceof SmsMessage;
    }

    protected function doSend(MessageInterface $message): SentMessage
    {
        if (!$message instanceof SmsMessage) {
            throw new UnsupportedMessageTypeException(__CLASS__, SmsMessage::class$message);
        }
private ?string $messageStream = null;

    public function __construct(string $key, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
    {
        $this->key = $key;

        parent::__construct($client$dispatcher$logger);
    }

    public function __toString(): string
    {
        return sprintf('postmark+api://%s', $this->getEndpoint()).($this->messageStream ? '?message_stream='.$this->messageStream : '');
    }

    protected function doSendApi(SentMessage $sentMessage, Email $email, Envelope $envelope): ResponseInterface
    {
        $response = $this->client->request('POST', 'https://'.$this->getEndpoint().'/email', [
            'headers' => [
                'Accept' => 'application/json',
                'X-Postmark-Server-Token' => $this->key,
            ],
            'json' => $this->getPayload($email$envelope),
        ]);

        
public function __construct(string $login, #[\SensitiveParameter] string $password, string $from, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)     {
        $this->login = $login;
        $this->password = $password;
        $this->from = $from;

        parent::__construct($client$dispatcher);
    }

    public function __toString(): string
    {
        return sprintf('iqsms://%s?from=%s', $this->getEndpoint()$this->from);
    }

    public function supports(MessageInterface $message): bool
    {
        return $message instanceof SmsMessage;
    }

    protected function doSend(MessageInterface $message): SentMessage
    {
        if (!$message instanceof SmsMessage) {
            throw new UnsupportedMessageTypeException(__CLASS__, SmsMessage::class$message);
        }
public function __construct(string $login, #[\SensitiveParameter] string $password, string $from, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)     {
        $this->login = $login;
        $this->password = $password;
        $this->from = $from;

        parent::__construct($client$dispatcher);
    }

    public function __toString(): string
    {
        return sprintf('lightsms://%s?from=%s', $this->getEndpoint()$this->from);
    }

    public function supports(MessageInterface $message): bool
    {
        return $message instanceof SmsMessage;
    }

    protected function doSend(MessageInterface $message): SentMessage
    {
        if (!$message instanceof SmsMessage) {
            throw new UnsupportedMessageTypeException(__CLASS__, SmsMessage::class$message);
        }
#[\SensitiveParameter] private readonly string $apiKey,         private readonly string $from,
        private readonly string $channel,
        HttpClientInterface $client = null,
        EventDispatcherInterface $dispatcher = null
    ) {
        parent::__construct($client$dispatcher);
    }

    public function __toString(): string
    {
        return sprintf('termii://%s?from=%s&channel=%s', $this->getEndpoint()$this->from, $this->channel);
    }

    public function supports(MessageInterface $message): bool
    {
        return $message instanceof SmsMessage && (null === $message->getOptions() || $message->getOptions() instanceof TermiiOptions);
    }

    protected function doSend(MessageInterface $message): SentMessage
    {
        if (!$message instanceof SmsMessage) {
            throw new UnsupportedMessageTypeException(__CLASS__, SmsMessage::class$message);
        }
private string $roomId;

    public function __construct(#[\SensitiveParameter] string $apiToken, string $roomId, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)     {
        $this->apiToken = $apiToken;
        $this->roomId = $roomId;
        parent::__construct($client$dispatcher);
    }

    public function __toString(): string
    {
        return sprintf('chatwork://%s?room_id=%s', $this->getEndpoint()$this->roomId);
    }

    public function supports(MessageInterface $message): bool
    {
        return $message instanceof ChatMessage && (null === $message->getOptions() || $message->getOptions() instanceof ChatworkOptions);
    }

    protected function doSend(MessageInterface $message): SentMessage
    {
        if (!$message instanceof ChatMessage) {
            throw new UnsupportedMessageTypeException(__CLASS__, ChatMessage::class$message);
        }
Home | Imprint | This part of the site doesn't use cookies.