comsolit/imasys-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

comsolit/imasys-php

最新稳定版本:v1.0.3

Composer 安装命令:

composer require comsolit/imasys-php

包简介

PHP Wrapper for Swissphone's IMASYS Mobile Messaging SMS-Service

README 文档

README

IMASYS PHP

IMASYS PHP is a PHP wrapper for the IMASYS XML API from Swissphone. Current capabilities are sending SMS messages and checking the message status.

Example: Send a text message and get message status

1. Enter credentials

$credentials = new Credentials('<YOUR_IMASYS_USER_ID>', '<YOUR_IMASYS_PASSWORD>');

2. Fetch portal list

$portalServers = PortalServers::fetchPortalServers($config['host'], $credentials);

3. Initialize connection

$connection = new Connection($credentials, $portalServers);

4. Send message

$sendMessageRequest = new SendMessageRequest('<THE MESSAGE>', '<PHONE_NUMBER>', '<ORIGINATOR_NAME>');
$sendMessageResponse = $connection->send($sendMessageRequest);

5. Get message status

sleep(10);
$batchStatusRequest = new BatchStatusRequest($sendMessageResponse->getBatchId());
$batchStatusResponse = $connection->send($batchStatusRequest);

foreach ($batchStatusResponse->getBatch()->getMessages() as $message) {
    print_r($message->getStatus());
}

The reason the sleep function is called is to wait for the message to arrive on the target.

References

统计信息

  • 总下载量: 1.21k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 8
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-13