Fixed in-line substitution if there is no object

This commit is contained in:
polkiko 2021-10-22 15:19:11 +02:00
parent 0c47a88098
commit fd64f8966b

View File

@ -207,7 +207,9 @@ if ($action == 'presend') {
}
// Make substitution in email content
$formmail->setSubstitFromObject($object, $langs);
if ($object) {
$formmail->setSubstitFromObject($object, $langs);
}
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object);
$substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.urlencode($object->thirdparty->tag).'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '';
$substitutionarray['__PERSONALIZED__'] = ''; // deprecated