From ad4851aa9523a70187f26654c011275f285a869e Mon Sep 17 00:00:00 2001 From: Dzmitry Kremez Date: Tue, 8 Aug 2023 13:12:01 +0100 Subject: [PATCH] Update readme about company in controller data attribute updates --- 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.