An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          


seven logo

seven SMS for Elgg


SMS provider for Elgg - hooks into the notifications_sms plugin and exposes a programmatic elgg_send_sms() helper.


MIT License
Elgg 2.1.x
PHP 5.6+

---

## 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)