run:R W Run
DIR
2026-04-08 19:26:37
R W Run
DIR
2026-04-08 20:21:26
R W Run
DIR
2026-04-08 19:24:59
R W Run
DIR
2026-02-23 13:40:55
R W Run
DIR
2026-04-08 19:25:05
R W Run
DIR
2026-04-08 19:24:45
R W Run
DIR
2026-04-08 19:25:23
R W Run
DIR
2026-04-08 19:25:07
R W Run
DIR
2026-04-08 19:24:45
R W Run
DIR
2026-04-08 19:29:21
R W Run
DIR
2026-04-08 19:19:35
R W Run
DIR
2026-02-24 14:03:17
R W Run
DIR
2026-04-08 19:26:43
R W Run
DIR
2026-04-08 19:25:58
R W Run
DIR
2026-04-08 19:24:43
R W Run
DIR
2026-04-08 19:25:42
R W Run
DIR
2026-04-18 10:01:16
R W Run
DIR
2026-04-08 19:39:45
R W Run
720 By
2026-04-08 19:19:31
R W Run
26.46 KB
2026-04-08 19:19:31
R W Run
6.71 KB
2026-04-08 19:19:30
R W Run
6.48 KB
2026-04-08 19:19:31
R W Run
5.16 KB
2026-04-08 19:19:28
R W Run
202 By
2026-04-08 19:19:27
R W Run
2.1 KB
2026-04-08 19:19:29
R W Run
1.84 KB
2026-04-08 19:19:31
R W Run
108.72 KB
2026-04-08 19:19:30
R W Run
5.92 KB
2026-04-08 19:19:31
R W Run
7.33 KB
2026-04-08 19:19:31
R W Run
19.06 KB
2026-04-08 19:19:27
R W Run
1.06 MB
2026-04-08 19:19:30
R W Run
1.15 MB
2026-04-08 19:19:31
R W Run
489 By
2026-04-08 19:19:30
R W Run
122.07 KB
2026-04-08 19:19:31
R W Run
47.63 KB
2026-04-08 19:19:30
R W Run
7.13 KB
2026-04-08 19:19:29
R W Run
1.47 KB
2026-04-08 19:19:28
R W Run
66.41 KB
2026-04-08 19:19:30
R W Run
6.54 KB
2026-04-08 19:19:28
R W Run
27.57 KB
2026-04-08 19:19:28
R W Run
5.91 KB
2026-04-08 19:19:29
R W Run
14.64 KB
2026-04-08 19:19:30
R W Run
104.32 KB
2026-04-08 19:19:29
R W Run
5.94 KB
2026-04-08 19:19:30
R W Run
10.55 KB
2026-04-08 19:19:26
R W Run
6.12 KB
2026-04-08 19:19:29
R W Run
11.65 KB
2026-04-08 19:19:29
R W Run
1.5 KB
2026-04-08 19:19:30
R W Run
270.93 KB
2026-04-08 19:19:30
R W Run
47.77 KB
2026-04-08 19:19:28
R W Run
15.41 KB
2026-04-08 19:19:31
R W Run
10.1 KB
2026-04-08 19:19:31
R W Run
80.13 KB
2026-04-08 19:19:29
R W Run
43.36 KB
2026-04-08 19:19:29
R W Run
134.87 KB
2026-04-08 19:19:31
R W Run
71.98 KB
2026-04-08 19:19:27
R W Run
1.45 KB
2026-04-08 19:19:30
R W Run
8.49 KB
2026-04-08 19:19:31
R W Run
839 By
2026-04-08 19:19:31
R W Run
144.14 KB
2026-04-08 19:19:31
R W Run
21.28 KB
2026-04-08 19:19:31
R W Run
65.07 KB
2026-04-08 19:19:31
R W Run
89.02 KB
2026-04-08 19:19:30
R W Run
176.75 KB
2026-04-08 19:19:26
R W Run
49.23 KB
2026-04-08 19:19:31
R W Run
127.34 KB
2026-04-08 19:19:32
R W Run
229 By
2026-04-08 19:19:28
R W Run
error_log
📄test_email_admin1.php
1<?php
2require __DIR__ . '/init.php';
3use WHMCS\Database\Capsule;
4
5$adminUsername = 'nitrolivetv';
6$templateName = 'Automatic Setup Successful';
7
8// --- CHANGE THIS ID ---
9$orderId = 1042; // Enter the Order ID here
10// ----------------------
11
12// 1. Find the User ID associated with this Order
13$order = Capsule::table('tblorders')->where('id', $orderId)->first();
14$target_userid = $order ? $order->userid : 0;
15
16if ($target_userid > 0) {
17 // 2. Fetch the GCLID for that user
18 $gclidValue = Capsule::table('tblcustomfieldsvalues')
19 ->where('fieldid', 34)
20 ->where('relid', $target_userid)
21 ->value('value');
22
23 // 3. Find a Service ID related to this order for the 'relid' context
24 // (Optional, but helps 'Setup' templates fill in product details)
25 $service = Capsule::table('tblhosting')->where('orderid', $orderId)->first();
26 $serviceId = $service ? $service->id : $orderId;
27
28 // 4. Pass it directly into the API
29 $result = localAPI('SendAdminEmail', [
30 'messagename' => $templateName,
31 'relid' => $serviceId,
32 'mergefields' => [
33 'gclid' => $gclidValue ?: "NO-GCLID-IN-DB"
34 ],
35 'to' => 'noreply@theservice4u.com',
36 ], $adminUsername);
37
38 echo "Order: " . $orderId . " | Found User: " . $target_userid . " | GCLID: " . ($gclidValue ?: "NONE");
39 echo '<pre>' . print_r($result, true) . '</pre>';
40} else {
41 echo "Error: Could not find an order with ID " . $orderId;
42}