mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-01-11 15:14:01 +01:00
Fix scelta allegato durante l'invio email
This commit is contained in:
parent
7ee3ec1a2b
commit
ae17680838
@ -229,12 +229,6 @@ elseif (post('op') == 'send-email') {
|
||||
// Conferma di lettura
|
||||
$mail->read_notify = post('read_notify');
|
||||
|
||||
// Stampe da allegare
|
||||
$prints = post('prints');
|
||||
foreach ($prints as $print) {
|
||||
$mail->addPrint($print);
|
||||
}
|
||||
|
||||
// Allegati originali
|
||||
$files = post('uploads');
|
||||
foreach ($files as $file) {
|
||||
@ -244,7 +238,7 @@ elseif (post('op') == 'send-email') {
|
||||
$mail->save();
|
||||
|
||||
// Invio mail istantaneo
|
||||
$email = EmailNotification::build($mail);
|
||||
$email = EmailNotification::build($mail, post('prints'));
|
||||
$email_success = $email->send();
|
||||
|
||||
if ($email_success) {
|
||||
|
@ -73,16 +73,16 @@ class EmailNotification extends PHPMailer implements NotificationInterface
|
||||
$this->WordWrap = 78;
|
||||
}
|
||||
|
||||
public static function build(Mail $mail, $exceptions = null)
|
||||
public static function build(Mail $mail, $prints = null, $exceptions = null)
|
||||
{
|
||||
$result = new self($mail->account->id, $exceptions);
|
||||
|
||||
$result->setMail($mail);
|
||||
$result->setMail($mail, $prints);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function setMail($mail)
|
||||
public function setMail($mail, $prints)
|
||||
{
|
||||
$this->mail = $mail;
|
||||
|
||||
@ -105,9 +105,8 @@ class EmailNotification extends PHPMailer implements NotificationInterface
|
||||
}
|
||||
|
||||
// Stampe
|
||||
$prints = $mail->prints;
|
||||
foreach ($prints as $print) {
|
||||
$this->addPrint($print['id'], $mail->id_record);
|
||||
$this->addPrint($print, $mail->id_record);
|
||||
}
|
||||
|
||||
// Conferma di lettura
|
||||
|
Loading…
Reference in New Issue
Block a user