... | @@ -35,14 +35,14 @@ To add notifications to a particular controller, add `include Notifyable` to the |
... | @@ -35,14 +35,14 @@ To add notifications to a particular controller, add `include Notifyable` to the |
|
def send_notifications
|
|
def send_notifications
|
|
log_event(
|
|
log_event(
|
|
@project,
|
|
@project,
|
|
nil,
|
|
:destroy,
|
|
additional_param: some_value,
|
|
additional_param: some_value,
|
|
url: url_to_item
|
|
url: url_to_item
|
|
).notify(user_or_list_of_users, as: :something)
|
|
).notify(user_or_list_of_users, as: :something)
|
|
end
|
|
end
|
|
```
|
|
```
|
|
|
|
|
|
If this function is called from the destroy method, then it will look for all the keys under `projects.destroy.something` or, if that does not exist, `projects.default.something`. It will then attempt to send a notification to `user_or_list_of_users`. If the url parameter is given, the notification on Project Forum will include a clickable link to the given url as `view <name of resource>`.
|
|
If this function is called, then it will look for all the keys under `projects.destroy.something` or, if that does not exist, `projects.default.something`. It will then attempt to send a notification to `user_or_list_of_users`. If the url parameter is given, the notification on Project Forum will include a clickable link to the given url as `view <name of resource>`.
|
|
|
|
|
|
### Variables
|
|
### Variables
|
|
Messages can include variables of the form `%{variable_name}`, which are passed to the log_event method as the additional_param values. Each of these params must have a string value.
|
|
Messages can include variables of the form `%{variable_name}`, which are passed to the log_event method as the additional_param values. Each of these params must have a string value.
|
... | | ... | |