Skip to content

Instantly share code, notes, and snippets.

@jondkinney
Created January 9, 2013 23:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jondkinney/4497972 to your computer and use it in GitHub Desktop.
Save jondkinney/4497972 to your computer and use it in GitHub Desktop.
-#Intercom Configuration
- if defined? IntercomRails
- if logged_in?
- if current_user.entrepreneur? && current_user.company.present? && current_user.company.current_campaign
- camp_name = current_user.company.current_campaign.name rescue 'None'
- camp_status = current_user.company.current_campaign.status rescue 'None'
- else
- camp_name = 'N/A'
- camp_status = 'N/A'
:erb
<%= intercom_script_tag({
app_id: 'lqs8w42b',
user_id: current_user.id,
email: current_user.email,
name: current_user.display_name,
created_at: current_user.created_at,
custom_data: {
roles: current_user.roles.collect{|r| r.name.capitalize}.join(', '),
current_campaign_name: camp_name,
current_campaign_status: camp_status,
rails_env: Rails.env.to_s
}},{
widget: {activator: '.intercom_widget'}
})
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment