-
Notifications
You must be signed in to change notification settings - Fork 5
/
test.php
60 lines (48 loc) · 1.48 KB
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
/*
* File: test.php
* Project: WhatsAppHelper
* Created Date: Mo Oct 2022
* Author: Ayatulloh Ahad R
* Email: [email protected]
* Phone: 085791555506
* -------------------------
* Last Modified: Mon Oct 03 2022
* Modified By: Ayatulloh Ahad R
* -------------------------
* Copyright (c) 2022 Indiega Network
* -------------------------
* HISTORY:
* Date By Comments
* ---------- --- ---------------------------------------------------------
*/
use ay4t\WhatsAppHelper\WhatsAppSG;
require 'vendor/autoload.php';
/* ------------------------ contoh penggunaan pertama ----------------------- */
$wa = new WhatsAppSG();
$wa->setPort('6789')
->setSenderPhone('085791555506')
->setRecepient('082255879157')
->setMessage('test kirim wa?');
var_dump($wa->SendText());
/**
* jika anda menggunakan nomor diluar indonesia
* Anda dapat mengatur locale dengan cara
*
* catatan:
* lihat kode negara aplha-2-code di link berikut
* https://www.iban.com/country-codes
*/
$wa = new WhatsAppSG();
$wa->setPort('6789')
->setLocale('US')
->setSenderPhone('085791555506')
->setRecepient('082255879157')
->setMessage('test kirim wa?');
var_dump($wa->SendText());
/* ------------------------- contoh penggunaan kedua ------------------------ */
$wa = new WhatsAppSG('082255879157', 'hallo ini coba kirim whatsapp');
$wa->setBaseUrl('https://127.0.0.1')
->setPort('6789')
->setSenderPhone('085791555506');
$result = $wa->SendText();