File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
/***************************************************************************
4
4
// * *
5
- // * Chatwoot WHMCS Addon (v1.0 ). *
5
+ // * Chatwoot WHMCS Addon (v1.1 ). *
6
6
// * This addon modules enables you integrate Chatwoot with your WHMCS *
7
7
// and leverage its powerful features. *
8
8
// * Tested on WHMCS Version: 7.9.2 (7.9.2-release.1). *
@@ -51,7 +51,12 @@ function hook_chatwoot_footer_output($vars) {
51
51
52
52
// Get client ID
53
53
if ($ vars ['clientsdetails ' ]['id ' ]) {
54
- $ clientid = $ vars ['clientsdetails ' ]['id ' ];
54
+ $ varsID = $ vars ['clientsdetails ' ]['id ' ];
55
+ }
56
+ if (!is_null ($ client )){
57
+ $ clientid = hash_hmac ("sha256 " , $ varsID , "nQ1ayoG5bu580LZkSxMJiO2 " );
58
+ } else {
59
+ $ clientid = uniqid ('v- ' , true );
55
60
}
56
61
57
62
// Get client email
@@ -75,7 +80,9 @@ function hook_chatwoot_footer_output($vars) {
75
80
<script>
76
81
window.onload = (event) => {
77
82
window. \$chatwoot.setUser(' $ clientid', {
78
- avatar_url: ' $ gravatarurl',
83
+ email: ' $ clientemail',
84
+ name: ' $ clientname',
85
+ avatar_url: ' $ gravatarurl',
79
86
})
80
87
window. \$chatwoot.setLabel(' $ chatwoot_label')
81
88
}
You can’t perform that action at this time.
0 commit comments