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.

xmlapi: could not find function "addautoresponder" in module email

Discussion in 'cPanel Developers' started by barlow, Sep 1, 2013.

  1. barlow

    barlow Member

    Joined:
    Mar 27, 2013
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Using xmlapi to manage email accounts has been going well until I started working with 'addautoresponder', which is coming back with the error "could not find function 'addautoresponder' in module 'email".

    Is there something I should know? Is there some new function? Am I accessing API 1 incorrectly? I read somewhere that API 1 requires an ordered param array rather than a hashed param array, but that's from some years ago, right?

    The code looks like this:

    PHP:
    $params = array('domain'=>$domain
                
    'email'=>$row['email'], 
                
    'from'=>$row['Full Name'], 
                
    'subject'=>$Subject,
                
    'body'=>$Body,
                
    'html'=>true,
                
    'interval'=>4,
                
    'start'=>$startTS,
                
    'stop'=>$endTS); 

    $res json_decode($xmlapi->api2_query($cpanelu"Email""addautoresponder"$params), true);
    Any suggestions or guidance would be appreciated.

    By the way, the people who developed xmlapi interface for CPANEL are heros!
     
  2. barlow

    barlow Member

    Joined:
    Mar 27, 2013
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    OK, to answer my own question. Looking through xmlapi.php revealed that there are query functions for API1 and API2 - I hadn't noticed, duh. So the *working* code looks like this, with an ordered array as per the API documentation and 'api1_query' called:

    PHP:
    $params = array($username
            
    $row['Full Name'], 
            
    $Subject,
            
    $Body,
            
    $domain,
            
    true,
            
    "us-ascii",
            
    4,
            
    $startTS,
            
    $endTS); 
                
    $res json_decode($xmlapi->api1_query($cpanelu"Email""addautoresponder"$params), true);
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,765
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page