Author Topic: Autoresponder  (Read 33934 times)

Offline sardzent

  • Jr. Member
  • **
  • Posts: 22
Re: Autoresponder
« Reply #30 on: August 01, 2007, 04:23:59 PM »
to bradyjfrey

     thank you for contact and i send email :)

to tille
 
    maybe you should think about dedicated vserver and set up your own system with postfix or exim with mysql database and as a webmail RC :)

Offline marinero.f

  • Newbie
  • *
  • Posts: 1
Re: Autoresponder
« Reply #31 on: November 15, 2007, 04:56:50 PM »
thanks Sardzent for your work ... i succeed installing the auto-response tab but i have some problems and after a lot of hours i decided to post here. Hoping you could help me ....

i ve followed your instructions , but i've always the same message :'Autoreponder active but no text provided.'
I succedeed connecting your pluggin with Hmail server . On roundcube i can see my vacation settings ("message" and "checkbox") but what ever i do, when i press save button i get this message.

I'm working with Rcube RC2 maybe it's the problem , well i've tried many times but without success...
On my test i've noticed that it could came from the check box (how we know if the checkbox is checked or not ?) the return answer seem to be always unchecked.
Or The other option could came from this line
if (rcmail_sauve_autoreply(get_input_value('activation_autoreply', RCUBE_INPUT_POST), get_input_value('message_autoreply', RCUBE_INPUT_POST)))

I have another question : where can i find the definition of rc functions (like "RCUBE_INPUT_POST").

Below my code it could help:


  /////////FONCTION DE SAUVEGARDE ET INJECTION DES DONNEES///////

function rcmail_sauve_autoreply($active, $message){
   global $DB, $CONFIG, $OUTPUT;
   $id_autorep= $_SESSION['username'];
   @ $DB_1 = new mysqli('localhost', 'userdatabase', 'pass_secure', 'hmail');
         if (mysqli_connect_errno()) {
      return false;
   }
   $RESULT_1 = $DB_1->query('UPDATE hm_accounts SET accountvacationmessageon =\'' . $active . '\', accountvacationmessage =\'' . $message . '\', mod_date=NOW() WHERE accountaddress = \'' . $id_autorep . '\'');
   if ( $RESULT_1 ) {
      return true;
   } else {
      return false;
   }
   $DB_1->close();
}
  /////////FORMULAIRE TEMPLATE///////
 
function rcmail_autoreply_form($attrib){
   global $DB, $CONFIG, $OUTPUT;
   $id_autorep= $_SESSION['username'];

   list($form_start, $form_end) = get_form_tags($attrib, 'sauve-autoreply');
   unset($attrib['form']);
   if (!$attrib['id'])
      $attrib['id'] = 'rcmSavautoreply';

  /////////RECUPERATION DES DONNEES///////       
      
   @ $DB_1 = new mysqli('localhost', 'userdatabase', 'pass_secure', 'hmail');
   $RESULT_1 = $DB_1->query('SELECT accountvacationmessageon , accountvacationmessage FROM hm_accounts WHERE accountaddress = \'' . $id_autorep . '\'');
   $ROWS_1 = $RESULT_1->num_rows;
   if ( $ROWS_1 == 1 ) {
      $ROW_3 = $RESULT_1->fetch_assoc();
      $got_accountvacationmessageon = $ROW_3['accountvacationmessageon'];
      $got_accountvacationmessage = $ROW_3['accountvacationmessage'];
   } else {
      $got_accountvacationmessageon = 0;
      $got_accountvacationmessage = '';
   }
   $DB_1->close();



   $attrib['name'] = $attrib['id'];

   $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary'));

   $a_show_cols = array('activation_autoreply'   => array('type' => 'checkbox', 'label' => 'activation_autoreply'),
            'message_autoreply'   => array('type' => 'textarea', 'size' => "300", 'rows' => "6")
         );


   $out = "$form_start\n\n";
      
   $field_id = 'activation_autoreply';
   $attrib['id'] = $field_id;
  $value = rcmail_get_edit_field($field_id, $got_accountvacationmessageon, $attrib, 'checkbox');
  $out .= sprintf("%s\n",
   $field_id,
      Q(rcube_label('activeautoreply')),
          $value);

   //
   $field_id = 'message_autoreply';
   $attrib['size'] = "60";
   $attrib['rows'] = "8";
   $attrib['id'] = $field_id;
   $value = rcmail_get_edit_field($field_id, $got_accountvacationmessage, $attrib, 'textarea');
   $out .= sprintf("%s\n",
      $field_id,
      Q(rcube_label('textautoreply')),
      $value);

   $out .= "\n$form_end";

   return $out;
}
  /////////CONTROLE DU BOUTON ENVOIE ///////
if ($_action=='sauve-autoreply') {

   if ( (($_POST['activation_autoreply']) == 1) && (strlen($_POST['message_autoreply']) < 2 ) ) {
      $OUTPUT->show_message('autoreplytoolow', 'error');
   } else {
      if (rcmail_sauve_autoreply(get_input_value('activation_autoreply', RCUBE_INPUT_POST), get_input_value('message_autoreply', RCUBE_INPUT_POST)))
         $OUTPUT->show_message('autoreplymodified', 'confirmation');
      else
         $OUTPUT->show_message('noautoreply', 'error');
   }
   
   rcmail_overwrite_action('autoreply');
}

parse_template('autoreply');
?>


Many users are looking for this pluggin to use it with Hmail server , it could help many users....
thanks for your help .... :)


running RC2/Hmail Server

Offline blair.sawler

  • Jr. Member
  • **
  • Posts: 34
Re: Autoresponder
« Reply #32 on: February 26, 2008, 11:11:39 PM »
Hi

This is great, I have been looking for this functionality. I am having a couple of issues though.

When I login, I get the following errors:

Line: 302
Char: 7
Error: Expected '}'

Line: 36
Char: 1
Error: 'rcube_webmail' is undefined
Code: 0

Any assistance would be appreciated!

Offline blair.sawler

  • Jr. Member
  • **
  • Posts: 34
Re: Autoresponder
« Reply #33 on: February 27, 2008, 07:21:01 AM »
Sorry I spoke to soon, I missed a "}"

Now I just have to fix the error where it does not think I typed any text in....

Offline sardzent

  • Jr. Member
  • **
  • Posts: 22
Re: Autoresponder
« Reply #34 on: March 25, 2008, 09:13:38 AM »
Quote from: blair.sawler
Sorry I spoke to soon, I missed a "}"

Now I just have to fix the error where it does not think I typed any text in....

This is only a problem about conditions with value in textfield, check the checkbox and then check amount of characters places as a autorespond text.

Offline climaxy

  • Newbie
  • *
  • Posts: 9
Re: Autoresponder
« Reply #35 on: March 26, 2008, 11:27:16 AM »
This is really great but unfortunately, after I've followed the steps according the how to, I face now the problem that the db connection within autoreply.inc is done via mysql....but I've a PostgreSQL DB running in the background....

As I'm not that proficient in php, my question is, if it's possible for someone, to provide the autoreply.inc also for PostgreSQL or in general with a SQL abstraction layer, so that in the end effect you've just to choose at the beginning of the config, which db type is used.....

I'm searchin' already desperately for an Autoresponder plugin and this one seems to be perfect (if it would work also with Pgsql :'( )
Please help!

thx&greetz,
climaxy

Offline sardzent

  • Jr. Member
  • **
  • Posts: 22
Re: Autoresponder
« Reply #36 on: March 27, 2008, 10:23:42 AM »
hmmm but there are only two connection to mysql, all do via mysqli (yep i should use more flexible mechanism but ... :)
please just have a look for http://pl2.php.net/manual/en/ref.pgsql.php there are examples how to write some simple functions.
If any big troubles just ask :)

Offline blair.sawler

  • Jr. Member
  • **
  • Posts: 34
Re: Autoresponder
« Reply #37 on: April 07, 2008, 08:28:19 PM »
Don't think that is the issue sardznet,

I had this typed in:

test 12345 Hello!

Nice to see you!

You mentioned to me that we need a connection to the MTA database, has anyone gotten this working on a shared hosting platform?


Quote from: sardzent
Quote from: blair.sawler
Sorry I spoke to soon, I missed a "}"

Now I just have to fix the error where it does not think I typed any text in....

This is only a problem about conditions with value in textfield, check the checkbox and then check amount of characters places as a autorespond text.

Offline jcip

  • Newbie
  • *
  • Posts: 4
Latest release of RoundCube?
« Reply #38 on: June 12, 2008, 10:06:59 AM »
Does this autoresponder still work with the latest version of RoundCube v0.1.1?

Offline sardzent

  • Jr. Member
  • **
  • Posts: 22
Autoresponder
« Reply #39 on: June 20, 2008, 11:32:56 AM »
Quote from: jcip;12538
Does this autoresponder still work with the latest version of RoundCube v0.1.1?


I don't know but I supose it does (maybe some small tuneup is needed)