Fix procedura invio email

This commit is contained in:
Dasc3er 2021-08-05 11:18:54 +02:00
parent ab27243f13
commit 4691573a28
2 changed files with 7 additions and 17 deletions

View File

@ -27,7 +27,7 @@ use Notifications\EmailNotification;
class SegnalazioneBug extends Resource implements RetrieveInterface, CreateInterface
{
protected static $bug_email = 'info@openstamanager.com';
protected static $bug_email = 'thomaszilio77@gmail.com';
public function retrieve($request)
{
@ -44,27 +44,18 @@ class SegnalazioneBug extends Resource implements RetrieveInterface, CreateInter
public function create($request)
{
$data = $request['data'];
$account = Account::where('predefined', true)->first();
// Preparazione email
$mail = new EmailNotification($account);
$mail = new EmailNotification($account, true);
// Destinatario
$mail->AddAddress(self::$bug_email);
// Oggetto
$mail->subject = 'Segnalazione bug App OSM '.$request['version'];
$infos = [
];
$body = '';
foreach ($infos as $key => $value) {
$body .= '<p>'.$key.': '.$value.'</p>';
}
// Contenuti
$mail->content = $body;
// Oggetto e contenuto
$mail->Subject = 'Segnalazione bug App OSM '.$data['version'];
$mail->Body = $data['body'];
// Tentativo di invio diretto
$email_success = $mail->send();

View File

@ -37,7 +37,7 @@ class EmailNotification extends PHPMailer implements NotificationInterface
public function __construct($account = null, $exceptions = null)
{
parent::__construct(true);
parent::__construct($exceptions);
$this->CharSet = 'UTF-8';
@ -215,7 +215,6 @@ class EmailNotification extends PHPMailer implements NotificationInterface
// Segnalazione degli errori
if (!$result) {
$logger = logger();
dd($this->infos);
foreach ($this->infos as $info) {
$logger->addRecord(\Monolog\Logger::ERROR, $info);
}