Index: /mods/wpsg_mod_abo.class.php
===================================================================
--- /mods/wpsg_mod_abo.class.php	(revision 7125)
+++ /mods/wpsg_mod_abo.class.php	(revision 7126)
@@ -79,4 +79,5 @@
 				expiration DATETIME NOT NULL,
 				inform_expiration int(1) DEFAULT '0' NOT NULL,
+				inform_autorenew int(1) DEFAULT '0' NOT NULL COMMENT 'Auf 1 wenn die Mail X-Tage vor verlÃ€ngerung gesendet wurde',
 				rebuy int(11) DEFAULT '0' NOT NULL,
 				status int(1) DEFAULT '0' NOT NULL,
@@ -585,5 +586,5 @@
                     
                     $this->autoExtendOrder($a['order_id'], $a['product_key']);
-                 die();   
+                    
                 }
                 else
@@ -602,4 +603,30 @@
 			}
 
+			// Informail vor automatischer VerlÃ€ngerung
+            if ($this->shop->get_option('wpsg_mod_abo_expiremode') === self::EXPIRE_AUTO && $this->shop->get_option('wpsg_mod_abo_autoexpire_information') == '1') {
+
+                $arAboInformation = $this->db->fetchAssoc("
+                    SELECT
+                        A.*
+                    FROM
+                        `".WPSG_TBL_ABO."` AS A
+                    WHERE
+                        DATEDIFF(A.`expiration`, NOW()) = ".wpsg_q($this->shop->get_option('wpsg_mod_abo_autoexpire_informationtime'))." AND
+                        A.`status` = '".wpsg_q(self::STATUS_ACTIVE)."' AND
+                        A.`inform_autorenew` != '1'
+                ");
+                
+                foreach ($arAboExpiration as $a) {
+
+                    $this->sendAboRenewInformation($a['order_id'], $a['product_key']);
+                    
+                    $this->db->UpdateQuery(WPSG_TBL_ABO, array(
+                        'inform_autorenew' => '1'
+                    ), "`id` = '".wpsg_q($a['id'])."'");
+                    
+                }                
+            
+            }
+
 		} // public function cron()
 
@@ -607,8 +634,9 @@
 		{
 
-			wpsg_saveEMailConfig("wpsgmodabofirstbuy");
-			wpsg_saveEMailConfig("wpsgmodaboexpiration");
-			wpsg_saveEMailConfig("wpsgmodabrebuy");
-            wpsg_saveEMailConfig("wpsgmodaboadminstoprenewal");
+			wpsg_saveEMailConfig('wpsgmodabofirstbuy');
+			wpsg_saveEMailConfig('wpsgmodaboexpiration');
+			wpsg_saveEMailConfig('wpsgmodabrebuy');
+            wpsg_saveEMailConfig('wpsgmodaboadminstoprenewal');
+            wpsg_saveEMailConfig('wpsgmodabautoinfo');
 
 		} // public function admin_emailconf_save()
@@ -1483,4 +1511,33 @@
 		} // public function sendAboFirstBuyMail($order_id, $product_id)
 
+        /**
+         * Sendet die Mail, die X-Tage vor der automatischen VerlÃ€ngerung versendet werden kann
+         * @param int $order_id BestellID
+         * @param String $product_key ProduktKey
+         */
+        public function sendAboRenewInformation($order_id, $product_key) {
+
+            if ($this->shop->get_option('wpsg_mod_abo_autoexpire_information') != '1') return;
+
+            $product_data = $this->shop->cache->loadProduct($this->shop->getProduktID($product_key));
+            $order_data = $this->shop->cache->loadOrder($order_id);
+            $customer_data = $this->shop->cache->loadKunden($order_data['k_id']);
+
+            $this->shop->view['oProduct'] = $this->shop->cache->loadProductObject($product_data['id']);
+            $this->shop->view['product'] = $product_data;
+            $this->shop->view['customer'] = $customer_data;
+            $this->shop->view['order'] = $order_data;
+
+            if ($this->shop->get_option('wpsg_htmlmail') === '1') $mail_html = $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_abo/mail_autoinformation_html.phtml', false);
+            else $mail_html = false;
+
+            $mail_text = $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_abo/mail_autoinformation.phtml', false);
+
+            $this->shop->sendMail($mail_text, $customer_data['email'], 'wpsgmodabautoinfo', array(), $order_id, $customer_data['id'], $mail_html);
+
+            return true;
+            
+        } // public function sendAboRenewInformation($order_id, $product_key)
+        
 		/**
 		 * Sendet die Mail bei ablauf eines Abos
Index: /views/mods/mod_abo/mail_autoinformation.phtml
===================================================================
--- /views/mods/mod_abo/mail_autoinformation.phtml	(revision 7125)
+++ /views/mods/mod_abo/mail_autoinformation.phtml	(revision 7126)
@@ -7,5 +7,5 @@
 ?><?php echo __('Hallo', 'wpsg'); ?> <?php echo wpsg_hspc($this->view['customer']['vname']); ?> <?php echo wpsg_hspc($this->view['customer']['name']); ?>,
  
-<?php echo wpsg_translate(__('Ihr Abonnement von Produkt "#1#" wird in #2# automatisch verlÃ€ngert.', 'wpsg'), $this->view['oProduct']->getProductName()); ?>  
+<?php echo wpsg_translate(__('Ihr Abonnement von Produkt "#1#" wird in #2# Tagen automatisch verlÃ€ngert.', 'wpsg'), $this->view['oProduct']->getProductName(), $this->get_option('wpsg_mod_abo_autoexpire_informationtime')); ?>  
  
 <?php echo __('Viele GrÃŒÃe', 'wpsg'); ?> 
Index: /views/mods/mod_abo/mail_autoinformation_html.phtml
===================================================================
--- /views/mods/mod_abo/mail_autoinformation_html.phtml	(revision 7125)
+++ /views/mods/mod_abo/mail_autoinformation_html.phtml	(revision 7126)
@@ -7,5 +7,5 @@
 ?><p><?php echo __('Hallo', 'wpsg'); ?> <?php echo wpsg_hspc($this->view['customer']['vname']); ?> <?php echo wpsg_hspc($this->view['customer']['name']); ?>,</p>
  
-<p><?php echo wpsg_translate(__('Ihr Abonnement von Produkt "#1#" wird in #2# automatisch verlÃ€ngert.', 'wpsg'), $this->view['oProduct']->getProductName()); ?></p> 
+<p><?php echo wpsg_translate(__('Ihr Abonnement von Produkt "#1#" wird in #2# Tagen automatisch verlÃ€ngert.', 'wpsg'), $this->view['oProduct']->getProductName(), $this->get_option('wpsg_mod_abo_autoexpire_informationtime')); ?></p> 
  
 <p><?php echo __('Viele GrÃŒÃe', 'wpsg'); ?></p> 
Index: /views/mods/mod_abo/settings_edit.phtml
===================================================================
--- /views/mods/mod_abo/settings_edit.phtml	(revision 7125)
+++ /views/mods/mod_abo/settings_edit.phtml	(revision 7126)
@@ -11,6 +11,6 @@
 <?php echo wpsg_drawForm_Input('wpsg_mod_abo_url', __('Standard URL fÃŒr Ablauf/VerlÃ€ngerung', 'wpsg'), $this->get_option('wpsg_mod_abo_url'), array ('help' => 'wpsg_mod_abo_url')); ?>
 <br />
-<?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_wpsgmodabofirstbuy', __('Mail bei erstem Kauf eines Abos', 'wpsg'), $this->get_option('wpsg_mod_abo_wpsgmodabofirstbuy'), array('hint' => wpsg_translate(__('nohspc_Mail wird bei Bezahlung der Abo Bestellung zusÃ€tzlich versendet. (mail_firstbuy.phtml) -> <a href="#1#">Konfiguration</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf#wpsgmodabofirstbuy'), 'help' => 'wpsg_mod_abo_wpsgmodabofirstbuy',)); ?>
-<?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_wpsgmodabrebuy', __('Mail bei Kauf einer VerlÃ€ngerung', 'wpsg'), $this->get_option('wpsg_mod_abo_wpsgmodabrebuy'), array('hint' => wpsg_translate(__('nohspc_Mail wird bei Bezahlung einer Abo VerlÃ€ngerung versendet. (mail_rebuy.phtml) -> <a href="#1#">Konfiguration</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf#wpsgmodabrebuy'), 'help' => 'wpsg_mod_abo_wpsgmodabrebuy',)); ?>
+<?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_wpsgmodabofirstbuy', __('Mail bei erstem Kauf eines Abos', 'wpsg'), $this->get_option('wpsg_mod_abo_wpsgmodabofirstbuy'), array('hint' => wpsg_translate(__('Mail wird bei Bezahlung der Abo Bestellung zusÃ€tzlich versendet. (mail_firstbuy.phtml) -> <a href="#1#">Konfiguration</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf#wpsgmodabofirstbuy'), 'help' => 'wpsg_mod_abo_wpsgmodabofirstbuy')); ?>
+<?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_wpsgmodabrebuy', __('Mail bei Kauf einer VerlÃ€ngerung', 'wpsg'), $this->get_option('wpsg_mod_abo_wpsgmodabrebuy'), array('hint' => wpsg_translate(__('Mail wird bei Bezahlung einer Abo VerlÃ€ngerung versendet. (mail_rebuy.phtml) -> <a href="#1#">Konfiguration</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf#wpsgmodabrebuy'), 'help' => 'wpsg_mod_abo_wpsgmodabrebuy')); ?>
 
 <br />
@@ -39,5 +39,5 @@
 	<?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_autoexpire_adminmail', __('Mail an Administrator', 'wpsg'), $this->get_option('wpsg_mod_abo_autoexpire_adminmail'), array ('help' => 'wpsg_mod_abo_autoexpire_adminmail')); ?>
 <br />	
-	<?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_autoexpire_information', __('Mail vor automatischer VerlÃ€ngerung versenden', 'wpsg'), $this->get_option('wpsg_mod_abo_autoexpire_information'), array('help' => 'wpsg_mod_abo_autoexpire_information')); ?>
+	<?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_autoexpire_information', __('Mail vor automatischer VerlÃ€ngerung versenden', 'wpsg'), $this->get_option('wpsg_mod_abo_autoexpire_information'), array('hint' => wpsg_translate(__('Mail wird X-Tage vor einer automatischen VerlÃ€ngerung versendet. (mail_autoinformation.phtml) -> <a href="#1#">Konfiguration</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf#wpsgmodabautoinfo'), 'help' => 'wpsg_mod_abo_autoexpire_information')); ?>
 	<div class="wpsg_mod_abo_autoexpire_informationactiv" style="display:none;">	
 		<?php echo wpsg_drawForm_Input('wpsg_mod_abo_autoexpire_informationtime', __('Zeitspanne zum Versenden der Informationsmail in Tagen', 'wpsg'), $this->get_option('wpsg_mod_abo_autoexpire_informationtime'), array('help' => 'wpsg_mod_abo_autoexpire_informationtime')); ?>
