PHP code example of helpscout / apps

1. Go to this page and download the library: Download helpscout/apps library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

helpscout / apps example snippets


use HelpScoutApp\DynamicApp;

T-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';
}

use HelpScoutApp\DynamicApp;

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