cybershubham Posted November 29, 2018 Share Posted November 29, 2018 Sometimes, some important emails are missed by the customer or they land in spam. I was looking for a module to show received emails to the client in client area like a widget below the support ticket widget. I found this feature on OVH and have also seen in few more sites. I am posting a screenshot for reference. If you're aware of any such existing module, please let me know. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 30, 2018 Share Posted November 30, 2018 20 hours ago, cybershubham said: Sometimes, some important emails are missed by the customer or they land in spam. I was looking for a module to show received emails to the client in client area like a widget below the support ticket widget. although not a widget (though i'm assuming you actually mean a homepage panel), clients can access their email history - either from the secondary navbar menu or their contact details page... 20 hours ago, cybershubham said: If you're aware of any such existing module, please let me know. i'm not aware of such a module, but if you needed a homepage panel, it wouldn't be that hard to write - it's just a query to the appropriate database table, with perhaps an optional limit to the number of emails retrieved... ... email links would be clickable with the email opening in a new tab, or maybe a popup window (as per the history page) if that is preferable. 0 Quote Link to comment Share on other sites More sharing options...
cybershubham Posted November 30, 2018 Author Share Posted November 30, 2018 3 minutes ago, brian! said: This is exactly what I am looking for. 0 Quote Link to comment Share on other sites More sharing options...
cybershubham Posted November 30, 2018 Author Share Posted November 30, 2018 I tried the below code, but unfortunately, it doesn't work. Can you please point out what's wrong: Thank you in advance! @brian! <?php use WHMCS\View\Menu\Item; use Illuminate\Database\Capsule\Manager as Capsule; function hook_clientemails($vars) { $client = Menu::context('client'); $output = ""; $emails = Capsule::table('tblemails') ->where('userid', $client->id) ->get(); foreach ($emails as $email) { $output .= '<tr onclick="popupWindow('viewemail.php?id={$email.id}', 'emailWin', '650', '450')"> <td class="text-center"><span class="hidden">{$email.normalisedDate}</span>{$email.date}</td> <td>{$email.subject}</td> <td class="text-center"><input type="button" class="btn btn-primary btn-sm" value="View" onclick="popupWindow('viewemail.php?id={$email.id}', 'emailWin', '650', '450')" /></td> </tr>'; } return array("clientemails" => $output); } add_hook("ClientAreaHomepagePanels", 1, "hook_clientemails") { $homePagePanels->addChild('clientemails', array( 'label' => 'Email History', 'icon' => 'fa-envelope', 'order' => 20, 'extras' => array( 'color' => 'gold', 'btn-link' => '/cart/clientarea.php?action=emails', 'btn-text' => 'View All', 'btn-icon' => 'fa-arrow-right', ), 'bodyHtml' => $output, )); } ?> 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 2, 2018 Share Posted December 2, 2018 On 30/11/2018 at 20:25, cybershubham said: I tried the below code, but unfortunately, it doesn't work. Can you please point out what's wrong it's right in some parts, wrong in others... rather than correct it, and to make it easier for other users to find and ask questions about, i've posted the thread below in Third Party Addons, with two versions of the hook included - the original hook that I previously used in this thread, and also a popup version that is closer to the version that you seem to want to use. 1 Quote Link to comment Share on other sites More sharing options...
yggdrasil Posted December 7, 2018 Share Posted December 7, 2018 I know this is off topic but did WHMCS already fixed the bug on which passwords are displayed in the email history? I'm not sure about you guys but that is a no, no in security. Passwords and logins can be viewed by anyone that logs into the customer account from the email history. 😞 0 Quote Link to comment Share on other sites More sharing options...
cybershubham Posted December 7, 2018 Author Share Posted December 7, 2018 5 minutes ago, yggdrasil said: I know this is off topic but did WHMCS already fixed the bug on which passwords are displayed in the email history? I'm not sure about you guys but that is a no, no in security. Passwords and logins can be viewed by anyone that logs into the customer account from the email history. 😞 Email history is already visible to clients by default. Above code just brings it as a homepage panel. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 7, 2018 Share Posted December 7, 2018 4 hours ago, yggdrasil said: I know this is off topic it's never stopped you in the past. 😛 4 hours ago, yggdrasil said: I'm not sure about you guys but that is a no, no in security. Passwords and logins can be viewed by anyone that logs into the customer account from the email history. including sub-accounts that don't have "View Emails" checkbox enabled I think... if true, I can fix that in the panel... but that's redundant if they can just view the email history from the secondary menu. 🙄 0 Quote Link to comment Share on other sites More sharing options...
yggdrasil Posted December 8, 2018 Share Posted December 8, 2018 9 hours ago, brian! said: Quote it's never stopped you in the past. 😛 I know and I'm very sorry for that behavior. Quote including sub-accounts that don't have "View Emails" checkbox enabled I think... if true, I can fix that in the panel... but that's redundant if they can just view the email history from the secondary menu. 🙄 Ohhh 🤦♂️. That is much worse then. Sub-accounts that don't have the proper access permissions to access a specific product from their main account could still access them as the passwords are leaked. I know it's a standard practice to state on emails that customers should change their logins once received by email (since email is not secure either), but lets be realistic. Some people don't and will always just use the defaults that WHMCS creates for them as they find it more comfortable just to log into their services directly from WHMCS. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.