2019-05-29 06:33:53 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) 2019. Invoice Ninja LLC (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Mail;
|
|
|
|
|
|
|
|
use App\Models\User;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
use Illuminate\Mail\Mailable;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
|
|
|
|
class BouncedEmail extends Mailable implements ShouldQueue
|
|
|
|
{
|
|
|
|
use Queueable, SerializesModels;
|
|
|
|
|
|
|
|
public $invitation;
|
|
|
|
/**
|
|
|
|
* Create a new message instance.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function __construct($invitation)
|
|
|
|
{
|
|
|
|
$this->invitation = $invitation;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Build the message.
|
|
|
|
*
|
|
|
|
* @return $this
|
|
|
|
*/
|
|
|
|
public function build()
|
|
|
|
{
|
|
|
|
$entity_type = class_basename(lcfirst($this->invitation->getEntityType()));
|
|
|
|
|
2019-11-27 11:27:24 +01:00
|
|
|
$subject = ctrans("texts.notification_{$entity_type}_bounced_subject", ['invoice' => $invoice->number]);
|
2019-05-29 06:33:53 +02:00
|
|
|
|
|
|
|
return
|
|
|
|
$this->from($invitation->user->email)
|
|
|
|
->text()
|
|
|
|
->subject($subject);
|
|
|
|
|
2019-12-30 22:59:12 +01:00
|
|
|
//todo
|
2019-05-29 06:33:53 +02:00
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
|
|
//todo determine WHO is notified!! In this instance the _user_ is notified
|
|
|
|
|
|
|
|
Mail::to($invitation->user->email)
|
|
|
|
//->cc('')
|
|
|
|
//->bcc('')
|
|
|
|
->queue(new BouncedEmail($invitation));
|
2019-12-30 22:59:12 +01:00
|
|
|
|
2019-05-29 06:33:53 +02:00
|
|
|
return $this->from('turbo124@gmail.com') //todo
|
|
|
|
->subject(ctrans('texts.confirmation_subject'))
|
|
|
|
->markdown('email.auth.verify', ['user' => $this->user])
|
|
|
|
->text('email.auth.verify_text');
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
}
|