mikofb/mtn-sms-cloud

Laravel 包,用于通过 MTN SMS CLOUD 服务执行短信营销活动。

1.0 2020-04-30 14:51 UTC

This package is auto-updated.

Last update: 2024-09-29 05:36:17 UTC


README

Laravel 包,用于通过 MTN SMS CLOUD 服务执行短信营销活动。

下载

在您的终端中输入以下命令。

composer require mikofb/mtn-sms-cloud

注册服务提供商

更新 config/app.php 中的 providers 数组。

'providers' => [

        /*
         * Laravel Framework Service Providers...
         */


        /*
         * Package Service Providers...
         */

        /*
         * Application Service Providers...
         */
        Mikofb\MtnSmsCloud\MtnSmsCloudServiceProvider::class,
    ],

如何使用它

use Mikofb\MtnSmsCloud\Core\MtnSmsCloud;

/**
 * Create a new Instance
 * 
 * @param string $sender_id = The desired sender_id
 * @param string $token = $token associated with $sender_id 
 */
$msa = new MtnSmsCloud($sender_id, $token);

/**
 * Send a new Campaign
 * 
 * @param array $recipients {Ex: ["225xxxxxxxx", "233xxxxxxxx"]}
 * @param string $message
 */
return $msa->newCampaign($recipients, $message);

/**
 * Retrieves on created Campaign
 * 
 * @param string $campaign_id
 * @param string $message
 */
return $msa->getCampaign($campaign_id, $message);

由 Mikofb 制作,倾注了❤️。