|
|||
|
Hello,
I am rewriting the cpanel auto-responder page which is available to webmail user when logging-in. Essentially I am looking for a way to get auto-responder status, if its on or off for the logged-in email account. I want to be able to determine this so I can set conditional text on the page. For example if the condition returns true then i would display text "Auto-responder is currently on for this account". I cannot seem to find a way to do this, although i note several ways to get auto-responder data using the api. Eg. Code:
<cpanel Email="getarsbody(FORM{'email'})">
Any help would be appreciated. |
|
||||
|
Quote:
HTML Code:
<cpanelfeature autoresponders> Autoresponders are enabled for this account. </cpanelfeature>
__________________
Need technical assistance? You can find your best avenue for support at: http://support.cPanel.net |
|
|||
|
Thanks for your response. However I do not believe cpanelfeature is what I need. That will "test" if the feature is enabled on the account through the feature list, but that is not what i am looking for. I am looking for a way to test if there is an auto-responder active on the currently logged-in mail users account. So if someone does not have the auto-responder on they would see text like "The auto-responder is off and you are receiving mail as usual." and if its on see a message such as:
Code:
Your auto-responder is currently ON. Click here to turn off.
Your response:
<cpanel Email="getarsbody(FORM{'email'})">
|
|
||||
|
Quote:
HTML Code:
<?cp Email::listautoresponders(The auto-responder is enabled) || 'The auto-responder is off and you are receiving mail as usual' ?>
__________________
Need technical assistance? You can find your best avenue for support at: http://support.cPanel.net |
|
|||
|
Still Open: Rewriting Auto-response Page, need assistance.
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 />
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>
Last edited by sirbrent; 06-08-2009 at 05:16 PM. Reason: Marked as Opened |
|
||||
|
Quote:
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
__________________
Need technical assistance? You can find your best avenue for support at: http://support.cPanel.net |
|
|||
|
Thanks so much. With your help, the resources and a little creativity I managed to accomplish exactly what I was hoping. x3 is a great interface but is starting to show its age, and in places it rough around the edges.
I changed the autoresponder feature (for webmail users) to be much simpler to use. Now a webmail user can do everything from autores.html, and is presented with a single form for setting a responder, and a simple on and off button. I will likely spice it up with some ajax, but for now it is working the way I envisioned. If you are interested, here is a snippet of my code: Code:
<cpanelif $appname==webmail>
<br />
<?cp Email::listautoresponders($LANG{'HCBAutoResStatOnMsg'} [br /] [br /]
[form method="POST" id="turnoffAR" name="turnoffAR" action="dodelautoresconfirm.html?email=$authuser&redirectdomain=$FORM{'domain'}"]
[input type="submit" class="input-button" value="$LANG{'HCBAutoResOffBtn'}"]
[/form]) domain=$FORM{'domain'} || '$LANG{'HCBAutoResStatOffMsg'}' ?>
<br /><br /><br />
<script type="text/javascript">
var waitpanel;
function register_validators() {
register_validator('nomatch','empty',[document.mainform.from],'<cpanel langprint="ValidatorAutoresFrom">');
register_validator('nomatch','empty',[document.mainform.subject],'<cpanel langprint="ValidatorAutoresSubject">');
register_validator('nomatch','empty',[document.mainform.arbody],'<cpanel langprint="ValidatorAutoresBody">');
realtime_validate_init('mainform');
}
function kill_utfmsg() {
if (!FORM['autoload']) { checkcharset(); }
document.getElementById('utfmsg').style.display='none';
}
YAHOO.util.Event.addListener(window, "load", kill_utfmsg, false);
YAHOO.util.Event.addListener(window, "load", register_validators, false);
function checkcharset() {
var current_encoding = '<cpanel getcharset="">';
var charEl = document.getElementById('charset');
var req_encoding = charEl.options[charEl.selectedIndex].value;
if (current_encoding == req_encoding) {
return;
}
/*
to dream :)
var prevCharSet = document.characterSet;
eval('document.characterSet = req_encoding;');
eval('document.inputEncoding = req_encoding;');
if (document.characterSet != prevCharSet) {
return;
} */
FORM['__cpanel__temp__charset__'] = req_encoding;
FORM['autoload'] = 1;
var QueryString = [];
for(var i in FORM) {
QueryString.push(i + '=' + FORM[i]);
}
show_loading("<cpanel langprint="CharEncodingSwitch">");
window.location.href = 'addars.html?' + QueryString.join('&');
}
function show_loading(action,body) {
if (!waitpanel) { waitpanel =
new YAHOO.widget.Panel("waitpanel",
{ width:"252px",
fixedcenter:true,
close:false,
draggable:false,
modal:true,
visible:false
}
);
}
waitpanel.setHeader(action);
var loadingimg = '<img src="img/yui/rel_interstitial_loading.gif" />';
if (body) {
waitpanel.setBody(body + '<br />' + loadingimg);
} else {
waitpanel.setBody(loadingimg);
}
waitpanel.render(document.body);
waitpanel.show();
}
var FORM = {};
parseForm();
function parseForm() {
var query = window.location.search.substring(1);
var parms = query.split('&');
for (var i=0; i<parms.length; i++) {
var pos = parms[i].indexOf('=');
if (pos > 0) {
var key = parms[i].substring(0,pos);
var val = parms[i].substring(pos+1);
FORM[key] = val;
}
}
}
</script>
<fieldset style="width: 550px;">
<legend><strong><?cp Email::listautoresponders($LANG{'HCBAutoResModifyFormTitle'}) || '$LANG{'HCBAutoResNewFormTitle'}' ?></strong></legend>
<form style="margin: 0px; padding: 0px;" method="POST" onSubmit="return do_validate(this.id);" id="mainform" name="mainform" action="doaddars.html">
<input type="hidden" id="charset" name="charset" value="utf-8">
<input type="hidden" id="email2" name="email2" value="<cpanel print="$authuser">">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="5" style="margin-top: 10px; margin-bottom: 10px;">
<tr>
<td width="60"><cpanel langprint="HCBAutoResFrom"></td>
<td width="386"><input type="text" size="30" id="from" name="from" value="<cpanel Email="getarsfrom(FORM{'email'})">">
<em>(eg. John Smith)</em></td>
</tr>
<tr>
<td><cpanel langprint="HCBAutoResSubject"></td>
<td><input type="text" size="55" id="subject" name="subject" value="<cpanel Email="getarssubject(FORM{'email'})">"></td>
</tr>
<tr>
<td><cpanel langprint="HCBAutoResMessage"></td>
<td></td>
</tr>
<tr>
<td colspan="2">
<textarea id="arbody" name="arbody" cols="75" rows="8" style="width: 100%; overflow: auto;"><cpanel Email="getarsbody(FORM{'email'})"></textarea>
</td>
</tr>
<tr>
<td colspan="2"><input type="checkbox" name="html" value="1" <cpanel Email="getarshtml(FORM{'email'})"> > <cpanel langprint="HCBAutoResHTML"></td>
</tr>
<tr>
<td colspan="2" style="text-align: center;"><input type="submit" class="input-button" value="<?cp Email::listautoresponders($LANG{'Modify'}) || '$LANG{'ARCreate'}' ?>"></td>
</tr>
</table>
</form>
</fieldset>
</cpanelif>
Code:
HCBAutoResHeadSingular=Autoresponder Configuration HCBAutoResDescWebmail=The autoresponder will provide automatic replies to your incoming mail. They are often used to provide a response in your absence, e.g., when you are on vacation or out of the office. HCBAutoResStatOnMsg=The autoresponse feature is currently <strong>ON</strong> for this mailbox. HCBAutoResStatOffMsg=The autoresponse feature is currently <strong>OFF</strong> for this mailbox.<br />To enable this feature set an autoresponse below. HCBAutoResOffBtn=Turn OFF HCBAutoResNewFormTitle=Create an Autoresponse HCBAutoResModifyFormTitle=Modify Current Autoresponse HCBAutoResFrom=From: HCBAutoResSubject=Subject: HCBAutoResMessage=Message: HCBAutoResHTML=HTML Message |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Auto email response to a visitors form submittal | Creemo | cPanel Newbies | 1 | 11-27-2006 07:30 AM |
| isn't URL rewriting on by default? | DWHS.net | cPanel and WHM Discussions | 1 | 07-09-2006 05:53 AM |
| Auto createacct with email done! Response? | Digisource | cPanel and WHM Discussions | 2 | 12-06-2004 07:13 PM |
| Feature Request- Auto Response | isol | cPanel and WHM Discussions | 4 | 10-31-2003 03:57 AM |
| How to make an auto index.html page? | hugo24 | cPanel and WHM Discussions | 15 | 05-26-2003 10:53 AM |