aptvision/rightfax

This library allows you to easily send faxes through a rightfax server API

Installs: 52 941

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 4

Forks: 0

Open Issues: 1

pkg:composer/aptvision/rightfax

0.0.3 2022-10-17 12:16 UTC

This package is auto-updated.

Last update: 2025-09-29 02:43:55 UTC


README

This library allows you to easily send faxes through a rightfax server API

Usage

use Aptvision\Rightfax\Resource\Recipient;
use Aptvision\Rightfax\Client;
use GuzzleHttp\Psr7\Stream;

$rightfax = new Client(
    'http://my-rightfax-server/Rightfax/API/',
    'my-username',
    'my-password'
);

// Create a stream for the document any way that suits best
$document = new Stream(fopen('/path/to/document', 'r'));

// Post the document to the rightfax API
$attachment = $rightfax->postAttachment($document);

// Create a recipient
$recipient = new Recipient('John Smith', '1234567890');

// Send the fax!
// Note that multiple recipients or attachments are allowed
$sendJob = $rightfax->sendFax([$recipient], [$attachment]);