Changeset View
Changeset View
Standalone View
Standalone View
src/app/Mail/SuspendedDebtor.php
<?php | <?php | ||||
namespace App\Mail; | namespace App\Mail; | ||||
use App\Tenant; | |||||
use App\User; | use App\User; | ||||
use App\Utils; | use App\Utils; | ||||
use Illuminate\Bus\Queueable; | use Illuminate\Bus\Queueable; | ||||
use Illuminate\Mail\Mailable; | use Illuminate\Mail\Mailable; | ||||
use Illuminate\Queue\SerializesModels; | use Illuminate\Queue\SerializesModels; | ||||
class SuspendedDebtor extends Mailable | class SuspendedDebtor extends Mailable | ||||
{ | { | ||||
Show All 18 Lines | class SuspendedDebtor extends Mailable | ||||
/** | /** | ||||
* Build the message. | * Build the message. | ||||
* | * | ||||
* @return $this | * @return $this | ||||
*/ | */ | ||||
public function build() | public function build() | ||||
{ | { | ||||
$user = $this->account; | $appName = Tenant::getConfig($this->account->tenant_id, 'app.name'); | ||||
$supportUrl = Tenant::getConfig($this->account->tenant_id, 'app.support_url'); | |||||
$cancelUrl = Tenant::getConfig($this->account->tenant_id, 'app.kb.account_delete'); | |||||
$subject = \trans('mail.suspendeddebtor-subject', ['site' => \config('app.name')]); | $subject = \trans('mail.suspendeddebtor-subject', ['site' => $appName]); | ||||
$moreInfoHtml = null; | $moreInfoHtml = null; | ||||
$moreInfoText = null; | $moreInfoText = null; | ||||
if ($moreInfoUrl = \config('app.kb.account_suspended')) { | if ($moreInfoUrl = Tenant::getConfig($this->account->tenant_id, 'app.kb.account_suspended')) { | ||||
$moreInfoHtml = \trans('mail.more-info-html', ['href' => $moreInfoUrl]); | $moreInfoHtml = \trans('mail.more-info-html', ['href' => $moreInfoUrl]); | ||||
$moreInfoText = \trans('mail.more-info-text', ['href' => $moreInfoUrl]); | $moreInfoText = \trans('mail.more-info-text', ['href' => $moreInfoUrl]); | ||||
} | } | ||||
$this->view('emails.html.suspended_debtor') | $this->view('emails.html.suspended_debtor') | ||||
->text('emails.plain.suspended_debtor') | ->text('emails.plain.suspended_debtor') | ||||
->subject($subject) | ->subject($subject) | ||||
->with([ | ->with([ | ||||
'site' => \config('app.name'), | 'site' => $appName, | ||||
'subject' => $subject, | 'subject' => $subject, | ||||
'username' => $user->name(true), | 'username' => $this->account->name(true), | ||||
'cancelUrl' => \config('app.kb.account_delete'), | 'cancelUrl' => $cancelUrl, | ||||
'supportUrl' => \config('app.support_url'), | 'supportUrl' => $supportUrl, | ||||
'walletUrl' => Utils::serviceUrl('/wallet'), | 'walletUrl' => Utils::serviceUrl('/wallet', $this->account->tenant_id), | ||||
'moreInfoHtml' => $moreInfoHtml, | 'moreInfoHtml' => $moreInfoHtml, | ||||
'moreInfoText' => $moreInfoText, | 'moreInfoText' => $moreInfoText, | ||||
'days' => 14 // TODO: Configurable | 'days' => 14 // TODO: Configurable | ||||
]); | ]); | ||||
return $this; | return $this; | ||||
} | } | ||||
Show All 16 Lines |