Jump to content

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

Link to comment
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.

Link to comment
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,

));

}

?>

 

Link to comment
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.

Link to comment
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. 😞

Link to comment
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. 

Link to comment
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. 🙄

Link to comment
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.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated