Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1319 from benetech/feature/#1206
Browse files Browse the repository at this point in the history
#1206 - integrate intercom custom attributes
  • Loading branch information
rupeshparab authored Jul 22, 2020
2 parents 02f377c + 65b57fa commit 45a6c8a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
9 changes: 8 additions & 1 deletion src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,13 @@ class App extends Component {
const {
modal, problemList, problemStore, userProfile,
} = this.props;
const { email, name } = userProfile;

const intercomAttributes = {
user_id: email,
email,
name,
};
return (
<React.Fragment>
<Helmet
Expand Down Expand Up @@ -561,7 +568,7 @@ class App extends Component {
<Route render={p => <NotFound {...p} />} />
</Switch>
</div>
{['teacher', 'other'].includes(userProfile.info.userType) && <Intercom appID={process.env.INTERCOM_APP_ID} />}
{['teacher', 'other'].includes(userProfile.info.userType) && <Intercom {...intercomAttributes} appID={process.env.INTERCOM_APP_ID} />}
<footer id="footer">
<h2 className="sROnly">
{' '}
Expand Down
12 changes: 0 additions & 12 deletions src/redux/userProfile/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,22 +243,10 @@ function* setUserProfileSaga() {
});
const {
email,
name,
userType,
} = payload;
ReactGA.set({
email,
});
if (!['teacher', 'other'].includes(userType)) {
return;
}
if (yield call(waitForIntercomToBoot, 5)) {
IntercomAPI('update', {
user_id: email,
email,
name,
});
}
});
}

Expand Down

0 comments on commit 45a6c8a

Please sign in to comment.