Skip to content

Commit

Permalink
New: Extrafields can be used as substitution key %EXTRA_XXX% into emails
Browse files Browse the repository at this point in the history
texts for members.
  • Loading branch information
eldy committed Apr 25, 2014
1 parent 03d73bc commit 298da30
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -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
Expand Down
Binary file removed doc/images/dolibarr_screenshot6.png
Binary file not shown.
8 changes: 7 additions & 1 deletion htdocs/adherents/class/adherent.class.php
Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 298da30

Please sign in to comment.