Introdotta possibilità di invio mail multiplo

This commit is contained in:
loviuz 2021-07-15 15:38:01 +02:00
parent 06d2fb9342
commit ee1618c095
1 changed files with 12 additions and 5 deletions

View File

@ -28,7 +28,7 @@ $smtp = $template->account;
$body = $module->replacePlaceholders($id_record, $template['body']); $body = $module->replacePlaceholders($id_record, $template['body']);
$subject = $module->replacePlaceholders($id_record, $template['subject']); $subject = $module->replacePlaceholders($id_record, $template['subject']);
$email = $module->replacePlaceholders($id_record, '{email}'); $emails = explode( ';', $module->replacePlaceholders($id_record, '{email}') );
$id_anagrafica = $module->replacePlaceholders($id_record, '{id_anagrafica}'); $id_anagrafica = $module->replacePlaceholders($id_record, '{id_anagrafica}');
// Campi mancanti // Campi mancanti
@ -80,10 +80,17 @@ if (!empty($template['bcc'])) {
echo ' echo '
<b>'.tr('Destinatari').' <span class="tip" title="'.tr('Email delle sedi, dei referenti o agente collegato all\'anagrafica.').'"><i class="fa fa-question-circle-o"></i></span></b> <b>'.tr('Destinatari').' <span class="tip" title="'.tr('Email delle sedi, dei referenti o agente collegato all\'anagrafica.').'"><i class="fa fa-question-circle-o"></i></span></b>
<div class="row" id="lista-destinatari"> <div class="row" id="lista-destinatari">';
<div class="col-md-12">
{[ "type": "email", "name": "destinatari[0]", "value": "'.$email.'", "icon-before": "choice|email", "extra": "onkeyup=\'aggiungiDestinatario();\'", "class": "destinatari", "required": 1 ]} $idx = 0;
</div>
foreach( $emails as $email ){
echo '
<div class="col-md-12">
{[ "type": "email", "name": "destinatari['.$idx++.']", "value": "'.$email.'", "icon-before": "choice|email", "extra": "onkeyup=\'aggiungiDestinatario();\'", "class": "destinatari", "required": 1 ]}
</div>';
}
echo '
</div> </div>
<br> <br>