Fix invio mail

This commit is contained in:
pek5892 2024-05-21 18:03:38 +02:00
parent fe8635b33f
commit 0feedd99aa
1 changed files with 3 additions and 4 deletions

View File

@ -30,8 +30,8 @@ $placeholder_options = [
'is_pec' => intval($smtp['pec']),
];
$body = $module->replacePlaceholders($id_record, $template['body'], $placeholder_options);
$subject = $module->replacePlaceholders($id_record, $template['subject'], $placeholder_options);
$body = $module->replacePlaceholders($id_record, $template->getTranslation('body'), $placeholder_options);
$subject = $module->replacePlaceholders($id_record, $template->getTranslation('subject'), $placeholder_options);
$emails = [];
if ($module->replacePlaceholders($id_record, '{email}')) {
@ -164,12 +164,11 @@ if ($smtp['pec'] == 1 && $module->getTranslation('title') == 'Fatture di vendita
echo '
<div class="col-md-6">
{[ "type": "select", "multiple": "1", "label": "'.tr('Allegati').'", "name": "uploads[]", "value": "'.implode(',', $uploads).'", "help": "'.tr('Allegati del documento o caricati nell\'anagrafica dell\'azienda.').'", "values": "query=SELECT `id`, `title` AS text FROM `zz_files` WHERE `id_module` = '.prepare($id_module).' AND `id_record` = '.prepare($id_record).' UNION SELECT `id`, CONCAT(`title`, \' (Azienda)\') AS text FROM `zz_files` WHERE `id_module` = '.(new Module())->getByField('title', 'Anagrafiche', Models\Locale::getPredefined()->id).' AND `id_record` = (SELECT `valore` FROM `zz_settings` WHERE `title` = \'Azienda predefinita\')", "link": "allegato" ]}
{[ "type": "select", "multiple": "1", "label": "'.tr('Allegati').'", "name": "uploads[]", "value": "'.implode(',', $uploads).'", "help": "'.tr('Allegati del documento o caricati nell\'anagrafica dell\'azienda.').'", "values": "query=SELECT `id`, `name` AS text FROM `zz_files` WHERE `id_module` = '.prepare($id_module).' AND `id_record` = '.prepare($id_record).' UNION SELECT `id`, CONCAT(`name`, \' (Azienda)\') AS text FROM `zz_files` WHERE `id_module` = '.(new Module())->getByField('title', 'Anagrafiche', Models\Locale::getPredefined()->id).' AND `id_record` = '.setting('Azienda predefinita').'", "link": "allegato" ]}
</div>
</div>';
echo '
<div class="row">
<div class="col-md-12">';
echo input([