https://github.com/seven-io/elgg
Send SMS from within elgg
https://github.com/seven-io/elgg
elgg elgg-plugin sms
Last synced: 11 days ago
JSON representation
Send SMS from within elgg
- Host: GitHub
- URL: https://github.com/seven-io/elgg
- Owner: seven-io
- Created: 2021-05-04T11:21:59.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T13:16:32.000Z (over 2 years ago)
- Last Synced: 2025-01-07T12:51:33.353Z (over 1 year ago)
- Topics: elgg, elgg-plugin, sms
- Language: PHP
- Homepage: https://www.seven.io
- Size: 183 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.txt
Awesome Lists containing this project
README
seven SMS for Elgg
SMS provider for Elgg - hooks into the notifications_sms plugin and exposes a programmatic elgg_send_sms() helper.
---
## Features
- **Notification Channel** - Registered as an `sms` delivery method for the Elgg notifications subsystem
- **Programmatic Send** - Use `elgg_send_sms($number, $text)` from any plugin
- **Notification Body Override** - Pass a custom `sms` field in `notify_user()` for SMS-specific copy
## Prerequisites
- [Elgg](https://elgg.org/) 2.1.x
- The bundled `notifications_sms` plugin enabled
- A [seven account](https://www.seven.io/) with API key ([How to get your API key](https://help.seven.io/en/developer/where-do-i-find-my-api-key))
## Installation
```bash
composer require seven.io/elgg
```
Enable the plugin via the Elgg admin under **Configure > Plugins**.
## Configuration
Open the seven plugin settings page and paste your API key.
## Usage
### As notification channel
Add `sms` to the delivery methods passed to `notify_user()`:
```php
notify_user($member->guid, 0, $subject, $message, [
'action' => 'something',
'object' => $entity,
'sms' => $sms, // SMS-specific copy; falls back to summary, then subject
'summary' => $summary,
'url' => $entity->getURL(),
], ['email', 'site', 'sms']);
```
### Programmatic send
```php
elgg_send_sms('+4987654210', 'HI2U!');
```
## Support
Need help? Feel free to [contact us](https://www.seven.io/en/company/contact/) or [open an issue](https://github.com/seven-io/elgg/issues).
## License
[MIT](LICENSE)