koberoc

Registered
Mar 4, 2013
1
0
1
cPanel Access Level
Website Owner
I've shared here, but please help

package Example::EditQuota;

sub describe
{

my $mail_delpop =
{
'category' => 'Cpanel',
'event' => 'Api2::Email::addpop',
'stage' => 'pre',
'hook' => 'Example::EditQuota::delpop',
'exectype' => 'module',
};

return [$mail_delpop];
}

sub delpop
{
my (undef, $params) = @_;
my $args = $params->{args};
my $domain = $args->{'domain'};
my $user= $args->{'email'};
my $quota= $args->{'quota'};
my $password= $args->{'password'};

if($quota<500)
{

//How to write here?
//Email::Addpop('domain','user','pass');
//use cPanel::PublicAPI;
//my $pubapi = cPanel::PublicAPI->new();
$pubapi->cpanel_api2_request(
'whostmgr',
{
'module' => 'Email',
'func' => 'addpop',
'user' => 'user',
},
{
'domain' => 'domain.com',
'email' => 'localuser',
'password' => 'pass',
'quota' => 42,
}
);

//PLEASE HELP ME

}

}1;