Download the PHP package songyue/yii2-message without Composer
On this page you can find all versions of the php package songyue/yii2-message. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-message
Yii2-message
System for users to send each other private messages.
- A user configurable ignorelist and admin configurable whitelist (administrators are able to fine-tune the definition of which users are able to write to whom) is supported.
- Encryption is not (yet?) supported.
- Uses Font Awesome (http://fontawesome.io/) for some icons
- Every message sent inside the messaging system can be forwarded to the recipient be e-mail automatically.
Prerequisites:
You need a Model with the 'id' and 'username' attributes. This needs to be an ActiveRecord or Model instance.
I suggest to use https://github.com/dektrium/yii2-user which works wonderful with this module.
Installation
Configuration
Add following lines to your main configuration file:
Sending E-Mails
If you want the system to automatically send E-Mails via Yii::$app->mailer you only need to provide an 'email' column in your ActiveRecord Model.
Use the $mailMessages module option to define which users are getting E-Mails. For Example:
You can overwrite the default e-mail views and layout by providing an @app/mail/ directory inside your Application.
Mailqueue
From version 0.4 and above you can use yii2-queue (https://github.com/yiisoft/yii2-queue) to send messages via a mail queue. Once you have yii2-queue configured in your application you can set
to let yii2-message push an EmailJob on to your queue instead of sending the E-Mail directly.
If you want to use an mailqueue like https://github.com/nterms/yii2-mailqueue you can override the 'mailer' configuration option in the module configuration. Since yii2-queue is stable and an official extension i personally prefer to use yii2-queue instead of 3rd party extensions.
Ignore List and Recipients Filter
The user can manage his own ignore list using the message/message/ignorelist route. You can place a callback that defines which users should be able to be messaged. For example, if you do not want your users to be able to write to admin users, do this:
The recipients filter is applied after the ignore list.
Actions
The following Actions are possible:
- inbox: https://your-domain/message/message/inbox
- sent messages: https://your-domain/message/message/sent
- compose a message: https://your-domain/message/message/compose
- delete a message: https://your-domain/message/message/delete/hash/
- view a message: https://your-domain/message/message/view/hash/
- manage your ignorelist: https://your-domain/message/message/ignorelist
You can place this code snippet in your layouts/main.php to give your users access to the message actions:
Since 0.3.0 you can render the compose view inside an Modal Widget like this:
For some common url rules, you can copy Module::$urlRules into your 'rules' section of the URL Manager.
Contributing to this project
Anyone and everyone is welcome to contribute.
License
Yii2-message is released under the GPLv3 License.
All versions of yii2-message with dependencies
yiisoft/yii2-swiftmailer Version ^2.0.0
yiisoft/yii2-bootstrap Version ^2.0.0
kartik-v/yii2-widget-select2 Version ^2.0
rmrevin/yii2-fontawesome Version ~2.17