Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
e628b0eeba
@ -171,6 +171,7 @@ if (empty($reshook)) {
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$thirdpartystatic = new Societe($db);
|
||||||
// Loop on each email and send it
|
// Loop on each email and send it
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
@ -200,6 +201,15 @@ if (empty($reshook)) {
|
|||||||
|
|
||||||
// Array of possible substitutions (See also file mailing-send.php that should manage same substitutions)
|
// Array of possible substitutions (See also file mailing-send.php that should manage same substitutions)
|
||||||
$substitutionarray['__ID__'] = $obj->source_id;
|
$substitutionarray['__ID__'] = $obj->source_id;
|
||||||
|
if ($obj->source_type == "thirdparty") {
|
||||||
|
$result = $thirdpartystatic->fetch($obj->source_id);
|
||||||
|
|
||||||
|
if ($result > 0) {
|
||||||
|
$substitutionarray['__THIRDPARTY_CUSTOMER_CODE__'] = $thirdpartystatic->code_client;
|
||||||
|
} else {
|
||||||
|
$substitutionarray['__THIRDPARTY_CUSTOMER_CODE__'] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
$substitutionarray['__EMAIL__'] = $obj->email;
|
$substitutionarray['__EMAIL__'] = $obj->email;
|
||||||
$substitutionarray['__LASTNAME__'] = $obj->lastname;
|
$substitutionarray['__LASTNAME__'] = $obj->lastname;
|
||||||
$substitutionarray['__FIRSTNAME__'] = $obj->firstname;
|
$substitutionarray['__FIRSTNAME__'] = $obj->firstname;
|
||||||
|
|||||||
@ -1569,6 +1569,7 @@ class FormMail extends Form
|
|||||||
|
|
||||||
// For mass emailing, we have different keys
|
// For mass emailing, we have different keys
|
||||||
$tmparray['__ID__'] = 'IdRecord';
|
$tmparray['__ID__'] = 'IdRecord';
|
||||||
|
$tmparray['__THIRDPARTY_CUSTOMER_CODE__'] = 'CustomerCode';
|
||||||
$tmparray['__EMAIL__'] = 'EMailRecipient';
|
$tmparray['__EMAIL__'] = 'EMailRecipient';
|
||||||
$tmparray['__LASTNAME__'] = 'Lastname';
|
$tmparray['__LASTNAME__'] = 'Lastname';
|
||||||
$tmparray['__FIRSTNAME__'] = 'Firstname';
|
$tmparray['__FIRSTNAME__'] = 'Firstname';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user