public function testSendFaxSendBroadcast() { //needs actual connection //replace with valid username and password $client = new MonopondSOAPClientV2("user", "password", MPENV::Local); $filedata = fread(fopen("./tests/sample.txt", "r"), filesize("./tests/sample.txt")); $filedata = base64_encode($filedata); // TODO: Setup Document $document = new MonopondDocument(); $document->FileName = "AnyFileName1.txt"; $document->FileData = $filedata; $document->Order = 0; // TODO: Setup FaxMessage $faxMessage = new MonopondFaxMessage(); $faxMessage->MessageRef = "Testing-message-1"; $faxMessage->SendTo = "61011111111"; $faxMessage2 = new MonopondFaxMessage(); $faxMessage2->MessageRef = "Testing-message-2"; $faxMessage2->SendTo = "61011111111"; // TODO: Setup FaxSendRequest $sendFaxRequest = new MonopondSendFaxRequest(); $sendFaxRequest->BroadcastRef = "Broadcast-test-1"; $sendFaxRequest->SendRef = "Send-Ref-1"; $sendFaxRequest->FaxMessages[] = $faxMessage; $sendFaxRequest->FaxMessages[] = $faxMessage2; $sendFaxRequest->Documents = array($document); $sendFaxRequest->SendFrom = "Test Fax"; // Call send fax method $sendRespone = $client->sendFax($sendFaxRequest); // print_r($sendRespone); }
<?php include_once './MonopondSOAPClient.php'; // TODO: Enter your own credentials here $client = new MonopondSOAPClientV2("username", "password", MPENV::Production); // TODO: Put your file path here $filedata = fread(fopen("./test.txt", "r"), filesize("./test.txt")); $filedata = base64_encode($filedata); /* Setup Documents */ $document = new MonopondDocument(); $document->FileName = "AnyFileName1.txt"; $document->FileData = $filedata; $document->Order = 0; $document2 = new MonopondDocument(); $document2->FileName = "AnyFileName2.txt"; $document2->FileData = $filedata; $document2->Order = 0; $document3 = new MonopondDocument(); $document3->FileName = "AnyFileName3.txt"; $document3->FileData = $filedata; $document3->Order = 0; $document4 = new MonopondDocument(); $document4->FileName = "AnyFileName4.txt"; $document4->FileData = $filedata; $document4->Order = 0; /* Setup FaxMessages (Each contains an array of document objects) */ $faxMessage = new MonopondFaxMessage(); $faxMessage->MessageRef = "Testing-message-1"; $faxMessage->SendTo = "61011111111"; $faxMessage->SendFrom = "Test Fax"; $faxMessage->Resolution = "normal";