Jump to content

WHMCS Hook 'AfterModuleSuspend' and notify cpanel contact email


babarnazmi

Recommended Posts

Hi,

 

I am trying to write a script for notifying cpanel email about domain suspension or unsuspension by hooking AfterModuleSuspend.

 

In my setup, each clients can order multiple domain/hosting for their own personal contacts but incase of non-payments end user never know why the hosting is suspended or domain is expired. In those cases mostly end user thinks its because of some problem at hosting side and they terminate the services because of suspensions.

 

So I am trying to write a script which will try to get the details and send HTML email to user about the suspension with reason if the cpanel email is different from client_email.

 

add_hook("AfterModuleSuspend", 1, "hook_cpanel_email_suspend_notification");

$cpanel_domain= $vars['params']['domain']; 
$cpanel_username=$vars['params']['username'];
$client_id = $vars['params']['clientsdetails']['userid'];
$client_company = $vars['params']['clientsdetails']['companyname'];
$client_email =$vars['params']['clientsdetails']['email'];

[b]$cpanel_email = $vars['params']['email'];[/b] //not sure it is correct, but some people are suggesting this.

But right now, I can see all variables are showing correct value but unable to get cpanel email? it is always blank but I can see valid email address in CPanel contact details. Any clue?

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