https://github.com/maymeow/cakephp-twilio
📱 Plugin to send SMS messages with Twilio Gateway.
https://github.com/maymeow/cakephp-twilio
cakephp cakephp-plugin messaging notifications php sms twilio
Last synced: 9 months ago
JSON representation
📱 Plugin to send SMS messages with Twilio Gateway.
- Host: GitHub
- URL: https://github.com/maymeow/cakephp-twilio
- Owner: MayMeow
- License: mit
- Created: 2020-06-02T16:15:06.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-02T20:31:45.000Z (about 6 years ago)
- Last Synced: 2025-10-13T22:09:41.064Z (9 months ago)
- Topics: cakephp, cakephp-plugin, messaging, notifications, php, sms, twilio
- Language: PHP
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# CakephpTwilio plugin for CakePHP
## Installation
You can install this plugin into your CakePHP application using [composer](https://getcomposer.org).
The recommended way to install composer packages is:
```
composer require maymeow/cakephp-twilio
```
Open your `src/Application.php` file and load module
```php
//add into bootstrap function
$this->addPlugin('CakephpTwilio');
```
To load component add it to `src/AppController.php` for whole application or to any of your controllers by demand.
```php
$this->loadComponent('CakephpTwilio.Twilio');
```
## Configuration
This plugin using Twilio/SDK. To sending SMS, Twilio account is required. From your
number management in settings recieve your SID and TOKEN and add following lines to your
config file `config/app_local.php`:
```php
[
//... other configuration
/**
* Twilio SMS gate configuration
*/
'Twilio' => [
/**
* From: use mobile phone number or string A-Za-z1-0 max length 11 characters
* @see https://www.twilio.com/docs
*/
'From' => '_NUMBER_OR_TEXT_',
'Sid' => '_YOUR_SID_',
'Token' => '_YOUR_TOKEN_'
],
// ... end of file
];
```
## How to use it
You can send message from any controller using Twilio component
```php
use CakephpTwilio\Model\Message;
$this->Twilio
->send(new Message('PhoneNumber', "Text"));
```
if you want change `from` variable
```php
$this->Twilio
->send(new Message('PhoneNumber', "Text", "NumberOrText"));
```