1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-16 19:40:44 +01:00

Revert "Fix scelta allegato durante l'invio email"

This reverts commit ae17680838b3eca099799e07dc3462e9ce741e2d.
This commit is contained in:
Fabio Lovato 2020-03-31 19:52:58 +02:00 committed by Thomas Zilio
parent 9a4a674afa
commit 0820cd3189
2 changed files with 12 additions and 5 deletions

View File

@ -229,6 +229,12 @@ elseif (post('op') == 'send-email') {
// Conferma di lettura // Conferma di lettura
$mail->read_notify = post('read_notify'); $mail->read_notify = post('read_notify');
// Stampe da allegare
$prints = post('prints');
foreach ($prints as $print) {
$mail->addPrint($print);
}
// Allegati originali // Allegati originali
$files = post('uploads'); $files = post('uploads');
foreach ($files as $file) { foreach ($files as $file) {
@ -238,7 +244,7 @@ elseif (post('op') == 'send-email') {
$mail->save(); $mail->save();
// Invio mail istantaneo // Invio mail istantaneo
$email = EmailNotification::build($mail, post('prints')); $email = EmailNotification::build($mail);
$email_success = $email->send(); $email_success = $email->send();
if ($email_success) { if ($email_success) {

View File

@ -73,16 +73,16 @@ class EmailNotification extends PHPMailer implements NotificationInterface
$this->WordWrap = 78; $this->WordWrap = 78;
} }
public static function build(Mail $mail, $prints = null, $exceptions = null) public static function build(Mail $mail, $exceptions = null)
{ {
$result = new self($mail->account->id, $exceptions); $result = new self($mail->account->id, $exceptions);
$result->setMail($mail, $prints); $result->setMail($mail);
return $result; return $result;
} }
public function setMail($mail, $prints) public function setMail($mail)
{ {
$this->mail = $mail; $this->mail = $mail;
@ -105,8 +105,9 @@ class EmailNotification extends PHPMailer implements NotificationInterface
} }
// Stampe // Stampe
$prints = $mail->prints;
foreach ($prints as $print) { foreach ($prints as $print) {
$this->addPrint($print, $mail->id_record); $this->addPrint($print['id'], $mail->id_record);
} }
// Conferma di lettura // Conferma di lettura