Skip to content

helpscout/helpscout-apps-php

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

Dynamic Apps Client Library

Client library to assist with building custom apps that integrate with Help Scout. More information: http://developer.helpscout.net/custom-apps/

Current Version

  • 1.1.1

Please see the Changelog for details.

Installation

The Help Scout apps client can be installed using Composer.

Composer

Inside of composer.json specify the following:

{
  "require": {
    "helpscout/apps": "1.1.*"
  }
}

Example Usage (1)

use HelpScoutApp\DynamicApp;

include 'src/HelpScoutApp/DynamicApp.php';

$app = new DynamicApp('SECRET-KEY-HERE');
if ($app->isSignatureValid()) {
        $customer = $app->getCustomer();
        $user     = $app->getUser();
        $convo    = $app->getConversation();
        $mailbox  = $app->getMailbox();

        $html = array(
        	'<p>Convo</p>',
			'<ul>',
				'<li>Id: ' . $convo->getId() . '</li>',
                '<li>Number: ' . $convo->getNumber() . '</li>',
                '<li>Subject: ' . $convo->getSubject() . '</li>',
            '</ul>',
			'<p>Customer</p>',
			'<ul>',
				'<li>First: ' . $customer->getFirstName() . '</li>',
                '<li>Last: ' . $customer->getLastName() . '</li>',
                '<li>Email: ' . $customer->getEmail() . '</li>',
			'</ul>',
			'<p>User</p>',
			'<ul>',
                '<li>First: ' . $user->getFirstName() . '</li>',
                '<li>Last: ' . $user->getLastName() . '</li>',
                '<li>Id: ' . $user->getId() . '</li>',
			'</ul>',
			'<p>Mailbox</p>',
			'<ul>',
			    '<li>ID: ' . $mailbox->getId() . '</li>',
			    '<li>Email: ' . $mailbox->getEmail() . '</li>',
			'</ul>'
        );
        echo $app->getResponse($html);
} else {
        echo 'Invalid Request';
}

Example Usage (2)

use HelpScoutApp\DynamicApp;

include 'src/HelpScoutApp/DynamicApp.php';

$app = new DynamicApp('SECRET-KEY-HERE');
if ($app->isSignatureValid()) {               
    echo $app->getResponse('<p>Hello World</p>');
} else {
    echo 'Invalid Request';
}

About

Client library to help with building custom apps to integrate with Help Scout

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages