Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • Project Forum Project Forum
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 116
    • Issues 116
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 14
    • Merge requests 14
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
    • Model experiments
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • EIPEIP
  • Project ForumProject Forum
  • Project ForumProject Forum
  • Wiki
  • Notifications

Notifications · Changes

Page history
Update Notifications authored Jun 08, 2021 by Taico Aerts's avatar Taico Aerts
Hide whitespace changes
Inline Side-by-side
Notifications.md
View page @ 43157a32
...@@ -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.
......
Clone repository
  • Cleanup after approval
  • Code Quality
  • Database Setup
  • Deployment
  • Elasticsearch Setup
  • Events
  • Home
  • Installation on Windows
  • Interesting features
  • Notifications
  • Overview of notifications
  • SAML
  • Thesis Workflow