Jump to content
cybershubham

Email Notifications Module

Recommended Posts

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.

 

 

Screenshot 2018-11-29 at 11.59.35 PM.png

Share this post


Link to post
Share on other sites
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...

aIVr2hx.pngrWy0smu.png

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...

DQLXRCX.pngcsDAqO6.png

... 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.

Share this post


Link to post
Share on other sites

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,

));

}

?>

 

Share this post


Link to post
Share on other sites
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.

  • Thanks 1

Share this post


Link to post
Share on other sites

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. 😞

Share this post


Link to post
Share on other sites
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. 

Share this post


Link to post
Share on other sites
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. 🙄

Share this post


Link to post
Share on other sites
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.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines