diff --git a/modules/articoli/edit.php b/modules/articoli/edit.php index 29ba00fd3..02be6b177 100644 --- a/modules/articoli/edit.php +++ b/modules/articoli/edit.php @@ -79,12 +79,9 @@ $_SESSION['superselect']['id_categoria'] = $record['id_categoria']; {[ "type": "select", "label": "", "name": "um", "value": "$um$", "ajax-source": "misure", "icon-after": "add|" ]} -
{[ "type": "checkbox", "label": "", "name": "abilita_serial", "value": "$abilita_serial$", "help": "", "placeholder": "", "extra": " 0) ? 'readonly' : ''; ?>" ]}
- - @@ -139,3 +141,17 @@ echo '
'.$mail->content.'
'; + +if (empty($mail->sent_at)) { + echo ' + + '.tr('Elimina').' +'; + + if ($mail->attempt >= 10) { + echo ' + + '.tr('Rimetti in coda').' +'; + } +} diff --git a/src/Notifications/EmailNotification.php b/src/Notifications/EmailNotification.php index 8dc18b63c..cdbf07037 100644 --- a/src/Notifications/EmailNotification.php +++ b/src/Notifications/EmailNotification.php @@ -159,6 +159,9 @@ class EmailNotification extends PHPMailer implements NotificationInterface $this->mail->failed_at = date('Y-m-d H:i:s'); } + // Salvataggio del numero di tentativi + $this->mail->attempt = $this->mail->attempt + 1; + $this->mail->save(); } @@ -226,7 +229,7 @@ class EmailNotification extends PHPMailer implements NotificationInterface $info = Prints::render($print['id'], $id_record, $path); $name = $name ?: $info['name']; - + $this->addAttachment($info['path'], $name); } diff --git a/update/2_4_11.sql b/update/2_4_11.sql index 0cb01279c..82170ecb1 100644 --- a/update/2_4_11.sql +++ b/update/2_4_11.sql @@ -853,3 +853,6 @@ UPDATE `zz_settings` SET `tipo` = 'list[1,2,3,4,5]' WHERE `nome` = 'Cifre decima -- Aggiunta percentuale combinata in listini ALTER TABLE `mg_listini` ADD `prc_combinato` VARCHAR(255); + +-- Aggiunto supporto ai tentativi di invio email +ALTER TABLE `em_emails` ADD `attempt` INT(11) NOT NULL DEFAULT 0;