';
}
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 5ff93994e73..a5446440f31 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -994,9 +994,9 @@ class FormMail extends Form
*
* @param DoliDB $db Database handler
* @param string $type_template Get message for type=$type_template, type='all' also included.
- * @param string $user Use template public or limited to this user
+ * @param string $user Get template public or limited to this user
* @param Translate $outputlangs Output lang object
- * @param int $id Id of template to find, or -1 for first found with position 0, or 0 for first found whatever is position or -2 for exact match with label (no aswer if not found)
+ * @param int $id Id of template to find, or -1 for first found with position 0, or 0 for first found whatever is position (priority order depends on lang provided or not) or -2 for exact match with label (no answer if not found)
* @param int $active 1=Only active template, 0=Only disabled, -1=All
* @param string $label Label of template
* @return ModelMail
@@ -1011,7 +1011,7 @@ class FormMail extends Form
return -1;
}
- $sql = "SELECT label, topic, joinfiles, content, content_lines, lang";
+ $sql = "SELECT rowid, label, topic, joinfiles, content, content_lines, lang";
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
$sql.= " WHERE (type_template='".$db->escape($type_template)."' OR type_template='all')";
$sql.= " AND entity IN (".getEntity('c_email_templates').")";
@@ -1033,6 +1033,7 @@ class FormMail extends Form
$obj = $db->fetch_object($resql);
if ($obj) {
+ $ret->id = $obj->rowid;
$ret->label = $obj->label;
$ret->lang = $obj->lang;
$ret->topic = $obj->topic;
diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php
index d26836fa646..f3369d58582 100644
--- a/htdocs/core/modules/modAdherent.class.php
+++ b/htdocs/core/modules/modAdherent.class.php
@@ -324,6 +324,12 @@ class modAdherent extends DolibarrModules
$this->import_fieldshidden_array[$r]=array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'adherent'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
$this->import_regex_array[$r]=array('a.civility'=>'code@'.MAIN_DB_PREFIX.'c_civility','a.fk_adherent_type'=>'rowid@'.MAIN_DB_PREFIX.'adherent_type','a.morphy'=>'(phy|mor)','a.statut'=>'^[0|1]','a.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','a.datefin'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
$this->import_examplevalues_array[$r]=array('a.civility'=>"MR",'a.lastname'=>'Smith','a.firstname'=>'John','a.login'=>'jsmith','a.pass'=>'passofjsmith','a.fk_adherent_type'=>'1','a.morphy'=>'"mor" or "phy"','a.societe'=>'JS company','a.address'=>'21 jump street','a.zip'=>'55000','a.town'=>'New York','a.country'=>'1','a.email'=>'jsmith@example.com','a.birth'=>'1972-10-10','a.statut'=>"0 or 1",'a.note_public'=>"This is a public comment on member",'a.note_private'=>"This is private comment on member",'a.datec'=>dol_print_date($now,'%Y-%m__%d'),'a.datefin'=>dol_print_date(dol_time_plus_duree($now, 1, 'y'),'%Y-%m-%d'));
+
+ // Cronjobs
+ $this->cronjobs = array(
+ 0=>array('label'=>'SendReminderForExpiredSubscription', 'jobtype'=>'method', 'class'=>'adherents/class/adherent.class.php', 'objectname'=>'Adherent', 'method'=>'sendReminderForExpiredSubscription', 'parameters'=>'10', 'comment'=>'sendReminderForExpiredSubscription', 'frequency'=>1, 'unitfrequency'=> 3600 * 24, 'priority'=>50, 'status'=>0, 'test'=>true),
+ );
+
}
diff --git a/htdocs/install/mysql/data/llx_c_email_templates.sql b/htdocs/install/mysql/data/llx_c_email_templates.sql
index 3a99e44cd8b..ad8d8ffd199 100644
--- a/htdocs/install/mysql/data/llx_c_email_templates.sql
+++ b/htdocs/install/mysql/data/llx_c_email_templates.sql
@@ -20,7 +20,9 @@
-- de l'install et tous les sigles '--' sont supprimés.
--
-INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendAnEMailToMember)',1,1,1,'__(CardContent)__','__(Hello)__,
\n__(Sincerely)__ __USER_SIGNATURE__',null);
+
+
diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang
index bfa338605f2..b6e872097b5 100644
--- a/htdocs/langs/en_US/members.lang
+++ b/htdocs/langs/en_US/members.lang
@@ -179,4 +179,8 @@ ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS=Product used for subscription line into in
NameOrCompany=Name or company
SubscriptionRecorded=Subscription recorded
NoEmailSentToMember=No email sent to member
-EmailSentToMember=Email sent to member at %s
\ No newline at end of file
+EmailSentToMember=Email sent to member at %s
+SendReminderForExpiredSubscriptionTitle=Send reminder by email for expired subscription
+SendReminderForExpiredSubscription=Send reminder by email to members when subscription is about to expire (parameter is number of days before end of subscription to send the remind)
+YourSubscriptionHasExpired=Your subscription has expired
+ThisIsContentOfSubscriptionReminderEmail=This is a email to remind you that your subscription is about to expire.