Browse code

Created repository.

DoubleBastionAdmin authored on 01/03/2022 23:31:10
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,38 @@
1
+<?php
2
+
3
+require_once('phaxio_config.php');
4
+require_once('autoload.php');
5
+
6
+$phaxio = new Phaxio($apiKeys[$apiMode], $apiSecrets[$apiMode], $apiHost);
7
+
8
+$params = array(
9
+    'to' => $toNumber,
10
+    'file' => array(
11
+        # Use open file handles to upload files
12
+        fopen('files/coverPage.html', 'r'),
13
+        fopen('files/content.pdf', 'r')
14
+    ),
15
+    'batch_delay' => 60
16
+);
17
+
18
+echo "Creating a 3 part batch with a one minute delay...\n";
19
+for ($i = 1; $i <= 3; $i++){
20
+    $result = $phaxio->sendFax($params);
21
+
22
+    var_dump($result);
23
+    echo "Part $i of 3 sent.  Sleeping for 5 seconds...\n";
24
+    sleep(5);
25
+}
26
+
27
+echo "First batch created successfully.  Sleeping for 50 seconds and creating a new batch.  First batch will start to send. \n\n";
28
+sleep(50);
29
+
30
+echo "Creating a 3 part batch with a one minute delay...\n";
31
+for ($i = 1; $i <= 3; $i++){
32
+    $result = $phaxio->sendFax($params);
33
+
34
+    var_dump($result);
35
+    echo "Part $i of 3 sent.  Sleeping for 5 seconds...";
36
+    sleep(5);
37
+}
38
+echo "Done.";