PHPackages                             condoedge/communications - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. condoedge/communications

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

condoedge/communications
========================

A communications package for kompo/kompo

v0.2.19(2mo ago)01.8k↓50%1MITPHPPHP ^8.0CI passing

Since Oct 18Pushed 2mo agoCompare

[ Source](https://github.com/condoedge/communications)[ Packagist](https://packagist.org/packages/condoedge/communications)[ RSS](/packages/condoedge-communications/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (12)Versions (41)Used By (1)

Communications
==============

[](#communications)

Concept of Working
------------------

[](#concept-of-working)

This package provides a way to handle communications within your application. It allows you to set up triggers, manage variables, and enhance context for events. The main idea is to have a way to send communications to users based on events that happen in the application. For example, you could send an email to a user when they register, or when they buy a product.

It provides a route */communication-templates* where you can edit/create the templates for the communications with variables and types of communications.

Steps to Use It
---------------

[](#steps-to-use-it)

### Installation

[](#installation)

To install the package, run the following command:

```
composer require condoedge/communications
```

### Publishing configuration

[](#publishing-configuration)

To publish the configuration file, use the following command:

```
php artisan vendor:publish --tag="condoedge-communications-config"
```

### Publishing javascript (Needed for the CKeditor)

[](#publishing-javascript-needed-for-the-ckeditor)

To publish the JavaScript files required for CKEditor, use the following command:

```
php artisan vendor:publish --tag="condoedge-communications-js"
```

### Setting communicables

[](#setting-communicables)

Each kind of communications has their own interface to be implemented by the communicable model. For example, the EmailCommunicable model implements the EmailCommunicable interface. So if the communication is an email, the communicable model should implement the EmailCommunicable interface or it'll be ignored.

Our actual interfaces are:

- `EmailCommunicable`
- `SMSCommunicable`
- `DatabaseCommunicable` (Notifications)

### Setting Up Triggers

[](#setting-up-triggers)

[![Listener flow](docs/listener-flow.png)](docs/listener-flow.png)

To set up a trigger, you need to create an event that will trigger the communication. Below is an example of how to create a trigger event:

```
