Comments (4)
Is what I am doing, the right path at least?
from notify-plugin.
@roulendz have you tried attaching other listeners to that event to see if it is firing as expected?
from notify-plugin.
So now I got to work, but still hard to understand few things!
Where I can change who will be notified? 'notifiable_id'
For example:
My model Appointment - stores 'student_id' and 'teacher_id' and there is relations Appointment::student and Appointment::teacher!
So I when: When a student books Appointment to the teacher, I want to notify the teacher, that student booked appointment with here.
I cannot figure how to overwrite that, because I all the time I get stored Auth user ID in 'notifiable_id'.
I tried in
SaveDatabaseAction.php change
/**
* Triggers this action.
* @param array $params
* @return void
*/
public function triggerAction($params)
{
if (
(!$definition = array_get($this->tableDefinitions, $this->host->related_object)) ||
(!$param = array_get($definition, 'param')) ||
(!$value = array_get($params, $param))
) {
throw new ApplicationException('Error evaluating the save database action: the related object is not found in the action parameters.');
}
if (!$value instanceof EloquentModel) {
// @todo Perhaps value is an ID or a model array,
// look up model $definition[class] from ID ...
}
$rule = $this->host->notification_rule;
$relation = array_get($definition, 'relation');
$value->$relation()->create([
'id' => Uuid::uuid4()->toString(),
'event_type' => $rule->getEventClass(),
'icon' => $this->host->icon ? $this->host->icon : 'icon-list-alt',
'notifiable_id' => $param['notifiable_id'],
'type' => $this->host->type,
'body' => 'Student booked appointment',
'data' => $this->getData($params),
'read_at' => null,
]);
}
buts till no luck.
Any suggestions.
from notify-plugin.
If you still need support with this, feel free to send us an email.
from notify-plugin.
Related Issues (20)
- Notification rule is missing a root condition - Improve error message HOT 20
- Conditions not saving the value field HOT 3
- I cannot save notification, i get "The mail template field is required" HOT 19
- Plugin interface not showing up in the settings area HOT 3
- ActionBuilder widget does not remember state of previous actions HOT 1
- How set host type in SaveDatabaseAction HOT 1
- Action class with repeater type field HOT 3
- I need more examples HOT 7
- Creates duplicates every time you view settings HOT 2
- [Feature Request] October Backend channel HOT 1
- Can't "Compose an email message" when "A user is registered" HOT 2
- The ModelAttributesConditionBase file may have errors on line 315 HOT 1
- Error on create notification condition HOT 4
- Can't create new notification, "Add Notification Rule" form is empty HOT 2
- Validation error when saving a notification with action with validation HOT 2
- Error on new notification rule creation HOT 1
- ExecutionContextCondition not evaluating 'theme' and 'context' conditions? HOT 1
- MIT License? HOT 2
- Manage timing of notifications HOT 5
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 notify-plugin.