bertoost / craft-messagebird
Craft CMS plugin for Messagebird messaging features.
Installs: 66
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:craft-plugin
Requires
- php: ^8.0 || ^8.1
- craftcms/cms: ^4.1 || ^5.0
- messagebird/php-rest-api: ^v3.1
This package is auto-updated.
Last update: 2024-12-20 09:16:06 UTC
README
Messagebird for Craft CMS
This plugin provides a Messagebird integration for Craft CMS.
Supports
- SMS features
The next services are in progress
- Voice features
- Report features (to view in CP)
Requirements
This plugin requires Craft CMS 3.1.5 or later.
Installation
You can install this plugin from the Plugin Store or with Composer.
From the Plugin Store
Go to the Plugin Store in your project’s Control Panel and search for “Messagebird”. Then click on the “Install” button in its modal window.
With Composer
Open your terminal and run the following commands:
# go to the project directory cd /path/to/my-project.test # tell Composer to load the plugin composer require bertoost/craft-messagebird # tell Craft to install the plugin ./craft install/plugin messagebird
Setup
Once Messagebird is installed, go to Settings → Messagebird, and enter your API key and SMS Originator name (max. 11 characters). Enter your Messagebird API Key (which you can get from dashboard.messagebird.com/en-us/developers/access), then click Save.
Tip: The API Key setting can be set to an environment variables. See Environmental Configuration in the Craft docs to learn more about that.
Usage
It's simple, so let's put in an example;
// Use the plugin use bertoost\messagebird\Plugin; // Send a SMS Plugin::getInstance()->getSms() // required: add at least one recipient & body ->addRecipient('+31600000000') ->setBody('This is a test') // optional: reference ->setReference('Testing SMS') // optional: schedule time ->setSchedule((new \DateTime())->modify('+5 minutes')) // send it ->send();