mirror of
https://github.com/devcode-it/openstamanager.git
synced 2024-12-29 09:11:11 +01:00
Fix procedura invio email
This commit is contained in:
parent
ab27243f13
commit
4691573a28
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user