diff --git a/mail.php b/mail.php index 8447d7cbd..038d0088d 100755 --- a/mail.php +++ b/mail.php @@ -28,7 +28,7 @@ $smtp = $template->account; $body = $module->replacePlaceholders($id_record, $template['body']); $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}'); // Campi mancanti @@ -80,10 +80,17 @@ if (!empty($template['bcc'])) { echo ' '.tr('Destinatari').' -
-
- {[ "type": "email", "name": "destinatari[0]", "value": "'.$email.'", "icon-before": "choice|email", "extra": "onkeyup=\'aggiungiDestinatario();\'", "class": "destinatari", "required": 1 ]} -
+
'; + + $idx = 0; + + foreach( $emails as $email ){ + echo ' +
+ {[ "type": "email", "name": "destinatari['.$idx++.']", "value": "'.$email.'", "icon-before": "choice|email", "extra": "onkeyup=\'aggiungiDestinatario();\'", "class": "destinatari", "required": 1 ]} +
'; + } +echo '