Seeuletter.com PHP Client is a simple but flexible wrapper for the Seeuletter.com API. See full Seeuletter.com documentation here. For best results, be sure that you're using the latest version of the Seeuletter API and the latest version of the PHP wrapper.
Here's a general overview of the Seeuletter services available, click through to read more.
Please read through the official API Documentation to get a complete sense of what to expect from each endpoint.
First, you will need to first create an account at Seeuletter.com and obtain your Test and Live API Keys.
Once you have created an account, you can access your API Keys from the API keys Panel.
The recommended way to install Seeuletter.com PHP Client is through Composer.
// Install Composer
curl -sS https://getcomposer.org/installer | php
// Add Seeuletter.com PHP client as a dependency
composer require seeuletter/seeuletter-php
After installing, you need to require Composer's autoloader:
require 'vendor/autoload.php';
<?php
require 'vendor/autoload.php';
// Provide an API Key in the class constructor
// in order to instantiate the Seeuletter object
$apiKey = 'your API Key here';
$seeuletter = new \Seeuletter\Seeuletter($apiKey);
$to_address = array(
'name' => 'Seeuletter',
'address_line1' => '30 rue de rivoli',
'address_line2' => '',
'address_city' => 'Paris',
'address_country' => 'France',
'address_postalcode' => '75004'
);
$letter = $seeuletter->letters()->create(array(
'to' => $to_address,
'source_file' => '@test.pdf',
'description' => 'Test Letters',
'color' => 'bw',
'source_file_type' => 'file',
'postage_type' => 'verte'
));
print_r($letter);
?>
<?php
require '../vendor/autoload.php';
$apiKey = 'your API key here';
$seeuletter = new \Seeuletter\Seeuletter($apiKey);
$to_address_electronic = array(
'first_name' => 'Erlich',
'last_name' => 'Dumas',
'company' => 'Seeuletter',
'email' => '[email protected]'
);
$letter = $seeuletter->letters()->createElectronic(array(
'to' => $to_address_electronic,
'source_file' => '<html>This is the electronic letter attached document</html>',
'source_file_type' => 'html',
'description' => 'Test Electronic Letters',
'content' => 'Please review the attached documents',
'postage_type' => 'lre'
));
print_r($letter);
?>
<?php
require 'vendor/autoload.php';
$seeuletter = new \Seeuletter\Seeuletter('test_12345678901234567890');
$letters = $seeuletter->letters()->all();
print_r($letters);
?>
<?php
require 'vendor/autoload.php';
$seeuletter = new \Seeuletter\Seeuletter('test_12345678901234567890');
$letter = $seeuletter->letters()->get('LETTER_ID');
print_r($letter);
?>
<?php
require 'vendor/autoload.php';
// Provide an API Key in the class constructor
// in order to instantiate the Seeuletter object
$seeuletter = new \Seeuletter\Seeuletter('test_12345678901234567890');
$account = $seeuletter->accounts()->create(array(
'email' => "[email protected]",
'name' => "Erlich Bachman",
'phone' => "+33104050607",
'company_name' => "MSB Partner from PHP Wrapper",
'address_line1' => '30 rue de rivoli',
'address_line2' => '',
'address_city' => 'Paris',
'address_country' => 'France',
'address_postalcode' => '75004'
));
print_r($account);
?>
<?php
require 'vendor/autoload.php';
// Provide an API Key in the class constructor
// in order to instantiate the Seeuletter object
$seeuletter = new \Seeuletter\Seeuletter('test_12345678901234567890');
$account_response = $seeuletter->accounts()->updateEmail("COMPANY_ID_HERE", "[email protected]");
?>
<?php
require 'vendor/autoload.php';
$seeuletter = new \Seeuletter\Seeuletter('test_12345678901234567890');
$letters = $seeuletter->invoices()->all();
print_r($letters);
?>
<?php
require 'vendor/autoload.php';
$seeuletter = new \Seeuletter\Seeuletter('test_12345678901234567890');
$letter = $seeuletter->invoices()->get('INVOICE_ID');
print_r($letter);
?>
We've provided various examples for you to try out here.
=======================
Copyright © 2017 Seeuletter.com
Released under the MIT License, which can be found in the repository in LICENSE.txt
.