Created
January 9, 2013 23:25
-
-
Save jondkinney/4497972 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-#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