View Single Post
  #7 (permalink)  
Old 06-08-2009, 05:36 PM
cPanelDavidG's Avatar
cPanelDavidG cPanelDavidG is offline
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 7,995
cPanelDavidG is on a distinguished road
Quote:
Originally Posted by sirbrent View Post
It is heading in the right direction

Might I ask for your expertise in abusing the API one more time???

What I am trying to output if the user has auto-responder enabled is this:

Code:
The auto-responder is currently enabled.
<a href="dodelautoresconfirm.html?email=%&redirectdomain=$FORM{'domain'}" onclick="delautoresconfirm('%');return false;">Turn off</a>
<br /><br />
Your response:
<br /><br />
<cpanel Email="getarsbody(FORM{'email'})">
<br /><br />
That looks a little messy, but hopefully you get the main idea -- <cpanel Email="getarsbody(FORM{'email'})"> would be replaced with the body of the set autoresponder.

So I imagine it would look something like this, I know this looks REALLY messy. I don't know how the syntax should look exactly, but the functionality should be roughly correct?

Code:
<cpanelif $appname==webmail>
<br />

<?cp Email::listautoresponders(The auto-responder is currently enabled. [a href="dodelautoresconfirm.html?email=%&redirectdomain=$FORM{'domain'}" onclick="delautoresconfirm\{leftparenthesis}'%'\{rightparenthesis};return false;"]Turn off[/a][br /][br /]Your response:[br /][br /]<cpanel Email="getarsbody(FORM{'email'})"])>[br /][br /]  || 'The auto-responder is off and you are receiving mail as usual' ?>

</cpanelif>
Thanks again for your help.
Embedding one API call within another makes a mess of things. Note that <cpanel Email="getarsbody(FORM{'email'})"])> returns an empty string when there is no auto-responder. So you can have your one API call, then that API call immediately after it.

I recommend you brush up on API2 syntax so you understand how to use % in API2. I did a presentation on API2 syntax at the 2007 cPanel Conference. I recommend looking at these slides beginning at slide 23 to understand API2 syntax:

http://twiki.cpanel.net/twiki/pub/Al...ing_cPanel.pdf
__________________
Want our technical analysts to login to your server to assist you? You can contact our technical analysts at: http://tickets.cPanel.net/submit
Reply With Quote