module MnoEnterprise::Concerns::Models::IntercomUser
Public Instance Methods
intercom_data(update_last_request_at = true)
click to toggle source
Return Intercom user data hash
# File lib/mno_enterprise/concerns/models/intercom_user.rb, line 30 def intercom_data(update_last_request_at = true) data = { user_id: self.id, name: [self.name, self.surname].join(' '), email: self.email, created_at: self.created_at.to_i, last_seen_ip: self.last_sign_in_ip, custom_attributes: { first_name: self.name, surname: self.surname, confirmed_at: self.confirmed_at, admin_role: self.admin_role }, update_last_request_at: update_last_request_at } data[:custom_attributes][:phone]= self.phone if self.phone data[:custom_attributes][:external_id]= self.external_id if self.external_id data end
intercom_user_hash()
click to toggle source
¶ ↑
Instance methods
¶ ↑
Return intercom user hash This is used in secure mode
# File lib/mno_enterprise/concerns/models/intercom_user.rb, line 25 def intercom_user_hash OpenSSL::HMAC.hexdigest('sha256', MnoEnterprise.intercom_api_secret, (self.id || self.email).to_s) if MnoEnterprise.intercom_api_secret end