Skip to content

Commit

Permalink
Fix code for cli must be similar to same code for gui version.
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jan 11, 2022
1 parent b824912 commit 71cf137
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/emailings/mailing-send.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@
$error++;
}

$thirdpartystatic = new Societe($db);

// Look on each email and sent message
$i = 0;
while ($i < $num2) {
Expand Down Expand Up @@ -200,6 +202,15 @@

// Array of possible substitutions (See also file mailing-send.php that should manage same substitutions)
$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['__LASTNAME__'] = $obj->lastname;
$substitutionarray['__FIRSTNAME__'] = $obj->firstname;
Expand Down

0 comments on commit 71cf137

Please sign in to comment.