From bfdd9141f5ea642b3ddb9cd570fa47912c6d4ac5 Mon Sep 17 00:00:00 2001 From: Dzmitry Kremez Date: Tue, 13 Feb 2024 09:14:12 +0000 Subject: [PATCH] Update readme about company in controller data attribute updates (#345) Co-authored-by: Dzmitry Kremez --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 2e3d8a7..1ee9f1b 100644 --- a/README.md +++ b/README.md @@ -240,6 +240,23 @@ config.company.custom_data = { } ``` +In some situations you'll want to set some custom company data attribute specific to a request. +You can do this similarly to user data attribute set by using the `intercom_custom_data` helper available in your controllers: + +```ruby +class AppsController < ActionController::Base + def activate + intercom_custom_data.company[:app_activated_at] = Time.now + ... + end + + def destroy + intercom_custom_data.company[:app_deleted_at] = Time.now + ... + end +end +``` + ### Messenger Intercom includes an in-app messenger which allows a user to read messages and start conversations.