import * as React from 'react' import InlineSVG from 'svg-inline-react' import { debounce } from 'lodash' import { Input, Button } from '@drifthq/tide' import './styles.styl' import { SettingsComponentProps } from './interfaces' import { APP_URL, GOOGLE_AUTH_URL, GOOGLE_CLIENT_ID, CONVERSATION_API } from '../../utils/ResourceConstants' import { encodeQueryData } from '../../utils/helpers' import Toggle from './Toggle' import Inboxes from './Inboxes' import { GoogleScope } from '../../modules/auth/constants' const close = require('!svg-inline-loader?removeTags=true&removeSVGTagAttrs=false!../../../img/svg/settings-close.svg') const driftLogo = require('!svg-inline-loader?removeTags=true&removeSVGTagAttrs=false!../../../img/svg/Drift_logo.svg') const saved = require('!svg-inline-loader?removeTags=true&removeSVGTagAttrs=false!../../../img/svg/save-check.svg') declare const __VERSION__: string class Settings extends React.Component { componentWillMount() { this.props.actions.fetchUserProperties() this.props.actions.fetchGoogleScopes() } debouncedSaveBccEmail = debounce((bccEmailAddress: string) => { this.props.actions.updateSetting({ bccEmailAddress }) const savedIcon = document.querySelector('.bcc-saved') as HTMLElement savedIcon.style.opacity = '1' setTimeout(() => { savedIcon.style.opacity = '0' }, 2000) }, 500) handleBccEmailChange = (bccEmailAddress: string) => { this.debouncedSaveBccEmail(bccEmailAddress) } handleGoogleConnectClick = () => { const scope = `${GoogleScope.READ} ${GoogleScope.SEND} ${GoogleScope.CALENDAR}` const params = { scope, redirect_uri: `${APP_URL}/accept-integration/google-calendar`, client_id: GOOGLE_CLIENT_ID, response_type: 'code', access_type: 'offline', include_granted_scopes: true, } window.open(`${GOOGLE_AUTH_URL}?${encodeQueryData(params)}`) } handleCSVdownloadClick = () => { const { accessToken } = this.props window.open(`${CONVERSATION_API}/sequences/per_rep_csv?access_token=${accessToken}`) } render() { const { handleManageNotifs, handleManageDomains, handleCloseSettings, bccStatus, bccEmailAddress, gmailConnected, hasExportSequenceData, actions: { updateSetting, logout }, } = this.props const inputProps = { spellCheck: false, } return (

Settings

Manage Notifications >
Browser Notifications

Get notified when prospects open and click your emails, visit pages on your site and when they start a conversation.

Manage Domains >
Unfollowed Domains

Stop seeing activity for email domains you’ve unfollowed.

Bcc Email Activity to CRM

Automatically log email activity in your CRM. We’ll add your CRM forwarding address as a BCC when you send a tracked email.

{bccStatus && (
Bcc Email Address
this.handleBccEmailChange(e.target.value)} {...inputProps} />
)}
Drift Sales Sequences

Enroll a contact in a Drift email sequence with one click. {' Sequences are sent on your behalf through your gmail account. '} Learn more .

{hasExportSequenceData && }
logout()}> logout
version {__VERSION__}
) } } export default Settings