Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 15 of 15
  1. #1
    Member
    Join Date
    Apr 2005
    Posts
    50

    Default api autoresponder

    Hi,
    I´am giving the first steps with the API so I can build a form to some users add an autoresponder.

    I´ve seen the documentation here ApiEmail < ApiDocs < TWiki

    and didn´t find no reference to 'addautoresponder' nor 'delautoresponder'.
    I´ve found across search here http://forums.cpanel.net/f42/xml-api...tml#post609885 that the add option exists in API1, although it´s not documented.

    Is this correct ? What is the function and arguments to remove it ?

    Thanks

  2. #2
    Member
    Join Date
    Apr 2005
    Posts
    50

    Default

    nobody ?
    There isn´t a function to remove an autoresponder ??

  3. #3
    cPanel Staff cPanelMatt's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default

    Quote Originally Posted by jcorreia View Post
    nobody ?
    There isn´t a function to remove an autoresponder ??
    There is, it's called Email::delautoresponder

    This is an API1 call, that uses the email address as it's only parameter.

    f.ex.


    <cpanel Email="delautoresponder($FORM{'email'})">

    or in xml-api:

    cpanel?cpanel_xmlapi_apiversion=1&cpanel_xmlapi_module=Email&cpanel_xmlapi_func=delautoresponder&arg-0=someemailaddress@domain.com
    Matt Dees
    Integration Developer
    cPanel, Inc.
    cPanel Integration Blog

  4. #4
    Member
    Join Date
    Apr 2005
    Posts
    50

    Default

    thank you

  5. #5
    Member
    Join Date
    Apr 2005
    Posts
    50

    Default

    APi documentation would be more helpful if it could permit user comments....php.net style

    just a suggestion...

  6. #6
    Member
    Join Date
    Apr 2005
    Posts
    50

    Default

    found a bug in delautoresponder.
    Even it the auto responder is not deleted it always returns success.

    Here is the array return on an error

    Code:
    array
      'module' => string 'Email' (length=5)
      'func' => string 'delautoresponder' (length=16)
      'type' => string 'event' (length=5)
      'source' => string 'internal' (length=8)
      'apiversion' => string '1' (length=1)
      'data' => 
        array
          'result' => 
            array
              empty
      'event' => 
        array
          'result' => string '1' (length=1)
    The error in my case was that I was not sending the full email. Just the part until the @. It was not deleted in cpanel, but the result returned is success.

    I have the last cpanel stable version.

    Thanks

  7. #7
    cPanel Staff cPanelMatt's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default

    Changes are coming to API1 in future versions that will fix this type of issue. We are aware of the problem and are working on it
    Matt Dees
    Integration Developer
    cPanel, Inc.
    cPanel Integration Blog

  8. #8
    Member
    Join Date
    Apr 2005
    Posts
    50

    Default bug if comma in message of autoresponder

    Hi,
    Found a Major bug with addautoresponder. If there is any comma in the message it won´t work. I almost went nuts because it was working sometimes, and others don´t

    This is what I´ve tried
    Code:
    $args =array($email_account,
                 "TESTES",
                 "Out of Office - %subject%",
                 "for any subject please contact my colleague  yyyyyyy (zzzz.zzzz@xxxxx.com)",
                 $email_domain,
                 true,
                 "ISO-8859-1",
                 8
                );
    $result=$xmlapi->api1_query($account, "Email", "addautoresponder",$args);
    var_dump($result);
    this works, but if you change the message to
    "for any subject, please contact my colleague yyyyyyy(zzzz.zzzz@xxxxx.com)"

    It won´t create the autoresponder (notice the comma after the 'subject')

    I was finishing development when I found this, so I´m stuck.

    Any workaround or a way to fix this ?

    Thanks

  9. #9
    Member
    Join Date
    Apr 2005
    Posts
    50

    Default

    This is what is sent in the html,

    arg-3=for+any+subject%2C+please+contact+my+colleague++yyyyyyy+%28zzzz.zzzz%40xxxxx.com%29

    so I suppose there is a problem when %2C is in the message.
    I wonder if there are more special chars problems...

  10. #10
    Registered User
    Join Date
    Jul 2008
    Posts
    4

    Default

    Quote Originally Posted by jcorreia View Post
    Hi,

    This is what I´ve tried
    Code:
    $args =array($email_account,
                 "TESTES",
                 "Out of Office - %subject%",
                 "for any subject please contact my colleague  yyyyyyy (zzzz.zzzz@xxxxx.com)",
                 $email_domain,
                 true,
                 "ISO-8859-1",
                 8
                );
    $result=$xmlapi->api1_query($account, "Email", "addautoresponder",$args);
    var_dump($result);
    What is the property of "TESTES" and 8 in your example, I cannot find the docs for addautoresponder anywhere...

    Thanks

  11. #11
    Registered User
    Join Date
    Jul 2008
    Posts
    4

    Default

    I can confirm the above mentioned bug. If a , (comma) is entered in the subject, the action fails.

  12. #12
    Member
    Join Date
    Apr 2005
    Posts
    50

    Default

    Hi,
    "TEstes" is the $from and '8' is the interval.

    You can check the details about this fields, in the cpanel autoresponder form.

    You didn´t find the documentation because there is none, I´ve discovered this reading the forums and struggling a lot


    I Wish someone from cpanel comment about this bug and roadmap for the fix.

  13. #13
    Member
    Join Date
    Apr 2005
    Posts
    50

    Default

    another thing, I didn´t tested the comma in the 'subject'.
    The 'subject' I mentioned is part of the 'message body', so you have found another bug, and I suspect this bug is spread along the API for all functions,
    so this is very important for cpanel staff to check.

    Thanks

  14. #14
    Member
    Join Date
    Apr 2005
    Posts
    50

    Default

    For someone who cares I´ve build a workaround for it, that is to cut all the commas in the message in the xmlapi.php
    It´s not pretty, but at least it will not fail to build the autoresponder.

    add this :
    Code:
    //workaround to comma fix of autoresponder
                   $args= str_replace("%2C","",$args);
    //workaround end
    after this
    Code:
    $args = http_build_query($vars, '', '&');
    in line 587

  15. #15
    Registered User
    Join Date
    Jul 2010
    Posts
    1

    Default

    Quote Originally Posted by jcorreia View Post
    Hi,
    I´am giving the first steps with the API so I can build a form to some users add an autoresponder.

    I´ve seen the documentation here ApiEmail < ApiDocs < TWiki

    and didn´t find no reference to 'addautoresponder' nor 'delautoresponder'.
    I´ve found across search here http://forums.cpanel.net/f42/xml-api-php-class-version-1-0-a-136449-p2.html#post609885 that the add option exists in API1, although it´s not documented.

    Is this correct ? What is the function and arguments to remove it ?

    Thanks
    I am struggling with exactly the same problem. I am pretty much a beginner, is there any easier "workaround" then the above mentioned?

    Thanks

Similar Threads & Tags
Similar threads

  1. Replies: 1
    Last Post: 06-04-2011, 09:52 AM
  2. Autoresponder Help..
    By g-e-tech.com in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 05-24-2005, 06:44 PM
  3. Autoresponder
    By powwowath in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-17-2004, 06:00 AM
  4. autoresponder
    By gate2vn in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 04-12-2004, 08:15 PM
  5. Autoresponder
    By Julie in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 11-19-2003, 10:23 AM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube