diff --git a/ChangeLog b/ChangeLog index f234a24e3ade4..0b70cbe719f14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -46,6 +46,7 @@ For users: - New: Add option FACTURE_SENDBYEMAIL_FOR_ALL_STATUS to allow to send invoice by email whatever is its status. - New: Add filter date in bank writing list page. +- New: Extrafields can be used as substitution key %EXTRA_XXX% into emails texts for members. - Fix: Project Task numbering customs rule works. - Fix: Add actions events not implemented. - Fix: Price min of composition is not supplier price min by quantity diff --git a/doc/images/dolibarr_screenshot6.png b/doc/images/dolibarr_screenshot6.png deleted file mode 100644 index ce44561aed6e9..0000000000000 Binary files a/doc/images/dolibarr_screenshot6.png and /dev/null differ diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index f82f3005514db..5f26d1106f748 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -169,7 +169,7 @@ function send_an_email($text, $subject, $filename_list=array(), $mimetype_list=a /** - * Make substitution + * Make substitution of tags into text with value of current object. * * @param string $text Text to make substitution to * @return string Value of input text string with substitutions done @@ -230,6 +230,12 @@ function makeSubstitution($text) '%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town, '%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country, ); + // Add extrafields as substitution key %EXTRA_XXX% + foreach($this->array_options as $key => $val) + { + $keyshort=preg_replace('/^(options|extra)_/','',$key); + $substitutionarray['%EXTRA_'.$keyshort.'%']=$val; + } complete_substitutions_array($substitutionarray, $langs);