The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

API Question

Discussion in 'cPanel Developers' started by koberoc, Apr 6, 2013.

  1. koberoc

    koberoc Registered

    Joined:
    Mar 4, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    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;
     
Loading...

Share This Page