Skip to content
Interface for Intercom
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.craftplugin
CHANGELOG.md
LICENSE.md
README.md
composer.json

README.md

Intercom plugin for Craft CMS 3.x

Interface for Intercom

Requirements

This plugin requires:

Installation

To install the plugin, follow these instructions.

cd {craft app folder}
composer config repositories.blasvicco.intercom vcs https://github.com/blasvicco/intercom.git
composer require blasvicco/intercom
./craft install/plugin intercom

Intercom Overview

Routes an email through intercom creating the user if doesn't exist.

Configuring Intercom

A file called config/intercom.php need to be created with the next settings:

return [
  'oauth'  => getenv('YOUR_INTERCOM_OAUTH_HERE'),
  'appId'  => getenv('YOUR_INTERCOM_APP_ID_HERE'),
  'body' => "WEB FORM:\nSubject: _PAGE_\n _DETAILS_",
  //'redirect' => '\home', // optional redirection when not ajax request
  'requireToken' => TRUE, // could it be FALSE and token validation will be skipped
];

Where _PAGE_ and _DETAILS_ are the fields from the $_POST.

Any $_POST fields are also available using the name like _EMAIL_ or _NAME_.

Using Intercom

In order to use the plugin after install you need to generate a FORM that post the next data structure:

  'ticket' => [
    'extra'   => 'a_valid_token',
    'email'   => 'a_valid_email',
    'name'    => 'not_empty_name',
    'details' => 'not_empty_details',
    'page'    => 'optional_page_title'
  ]

A valid token can be requested to intercom/api/token that will return a JSON like this one:

{
  "token":"Z0FmbC9tbnFXSnBUMmZHZDZNZV..."
}

Tokens are valid for no more than 5 minutes.

Brought to you by Blas Vicco

You can’t perform that action at this time.