PHP code example of igniterlabs / ti-ext-smsnotify

1. Go to this page and download the library: Download igniterlabs/ti-ext-smsnotify library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

igniterlabs / ti-ext-smsnotify example snippets


public function registerSmsNotifications()
{
    return [
        'channels' => [
            'twilio' => \IgniterLabs\SmsNotify\Notifications\Channels\Twilio::class,
        ],
        'template' => [
            'igniterlabs.smsnotify::_sms.new_order' => 'igniterlabs.smsnotify::default.template.text_order_placed',
        ],
    ];
}

class Twilio extends \IgniterLabs\SmsNotify\Classes\BaseChannel
{
    /**
     * Returns information about this channel, including name and description.
     */
    public function channelDetails()
    {
        return [
            'name'        => 'Twilio SMS Channel',
            'description' => '',
        ];
    }

    public function defineFormConfig()
    {
        return [
            'status' => [
                'label' => 'Status',
                'type' => 'switch',
                'default' => FALSE,
                'span' => 'left',
                'tab' => 'Twilio',
            ],
            'account_sid' => [
                'label' => 'Account SID',
                'type' => 'text',
                'tab' => 'Twilio',
            ],
            ...
        ];
    }
    
    public function send($to, $content)
    {
        //
    }
}