Skip to content

Commit c928b35

Browse files
Send mail on issue in deactivate
1 parent 9ddd0d2 commit c928b35

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/cloudlinux.inc.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ function deactivate_cloudlinux($ipAddress, $type = false)
4141
} else {
4242
$response = $cl->remove($ipAddress, $type);
4343
}
44+
if (!isset($response['success']) || $response['success'] !== true) {
45+
$bodyRows = [];
46+
$bodyRows[] = 'License IP: '.$ipAddress.' unable to deactivate.';
47+
$bodyRows[] = 'Deactivation Response: .'.json_encode($response);
48+
$subject = 'Cloudlinux License Deactivation Issue IP: '.$ipAddress;
49+
$smartyE = new TFSmarty;
50+
$smartyE->assign('h1', 'Cloudlinux License Deactivation');
51+
$smartyE->assign('body_rows', $bodyRows);
52+
$msg = $smartyE->fetch('email/client/client_email.tpl');
53+
(new \MyAdmin\Mail())->multiMail($subject, $msg, ADMIN_EMAIL, 'client/client_email.tpl');
54+
}
4455
request_log('licenses', false, __FUNCTION__, 'cloudlinux', 'removeLicense', [$ipAddress, $type], $response);
4556
myadmin_log('cloudlinux', 'info', "Deactivate CloudLinux({$ipAddress}, {$type}) Resposne: ".json_encode($response), __LINE__, __FILE__);
4657
return true;

0 commit comments

Comments
 (0)