2019-05-29 06:33:53 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2019-05-29 06:33:53 +02:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2024-04-12 06:15:41 +02:00
|
|
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
2019-05-29 06:33:53 +02:00
|
|
|
*
|
2021-06-16 08:58:16 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2019-05-29 06:33:53 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Mail;
|
|
|
|
|
|
|
|
use Illuminate\Mail\Mailable;
|
2022-01-15 05:07:40 +01:00
|
|
|
use Illuminate\Support\Facades\App;
|
2019-05-29 06:33:53 +02:00
|
|
|
|
2022-06-21 11:57:17 +02:00
|
|
|
class BouncedEmail extends Mailable
|
2019-05-29 06:33:53 +02:00
|
|
|
{
|
|
|
|
public $invitation;
|
2020-09-06 11:38:10 +02:00
|
|
|
|
2019-05-29 06:33:53 +02:00
|
|
|
public function __construct($invitation)
|
|
|
|
{
|
|
|
|
$this->invitation = $invitation;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Build the message.
|
|
|
|
*
|
|
|
|
* @return $this
|
|
|
|
*/
|
|
|
|
public function build()
|
|
|
|
{
|
2022-01-15 05:07:40 +01:00
|
|
|
App::setLocale($this->invitation->company->getLocale());
|
|
|
|
|
2019-05-29 06:33:53 +02:00
|
|
|
$entity_type = class_basename(lcfirst($this->invitation->getEntityType()));
|
|
|
|
|
2022-01-15 05:07:40 +01:00
|
|
|
$subject = ctrans("texts.notification_{$entity_type}_bounced_subject", ['invoice' => $this->invitation->invoice->number]);
|
2022-06-21 11:57:17 +02:00
|
|
|
|
2019-05-29 06:33:53 +02:00
|
|
|
return
|
2020-12-03 12:00:34 +01:00
|
|
|
$this->from(config('mail.from.address'), config('mail.from.name'))
|
2022-02-02 22:57:11 +01:00
|
|
|
->text('bounced mail')
|
2019-05-29 06:33:53 +02:00
|
|
|
->subject($subject);
|
|
|
|
}
|
|
|
|
}
|