Comments (2)
@gitrequests Thanks for reporting this.
A notification could have a lot of different attributes associated with it (URLs, related actors, icons etc.) that you might want to use in your application, therefore, it is really hard to cover all the possible variations within an extension and keep it lightweight at the same time.
I am planning to add data
attribute that will contain JSON encoded data related to the notification in the future major release.
However, you can already solve this problem by json encoding necessary data in $body
attribute. It is similar to what you already doing except for using Json::decode
instead of explode
.
$message->body = Json::encode(['actionUrl' => '/some/url', 'message' => 'Test messaage']);
...
$data = Json::decode($notification->body);
$url = $data['actionUrl'];
$message = $data['message'];
from yii2-notifications.
Resolved in #23
from yii2-notifications.
Related Issues (16)
- Add support for database notifications HOT 2
- Add information about logging
- SQL error while migrate/up HOT 2
- Calling unknown method: yii\db\ActiveQuery::addOnCondition() HOT 1
- Error sending many notifications in ActiveRecordChannel
- Add support for push notifications HOT 2
- Migration NameSpace HOT 3
- update read me HOT 2
- Error of default apiUrl of TelegramChannel HOT 3
- Help needed: notification example
- The MailChannel does not take into consideration the subject field HOT 1
- How to use NotifiableBehavior? HOT 1
- Migration fails. Rename required HOT 1
- Wrong class name HOT 1
- Wrong call to insert HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-notifications.