Page MenuHomePhorge

NegativeBalanceSuspended.php
No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None

NegativeBalanceSuspended.php

<?php
namespace App\Mail;
use App\Jobs\WalletCheck;
use App\User;
use App\Utils;
use App\Wallet;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class NegativeBalanceSuspended extends Mailable
{
use Queueable;
use SerializesModels;
/** @var \App\Wallet A wallet with a negative balance */
protected $wallet;
/** @var \App\User A wallet controller to whom the email is being sent */
protected $user;
/**
* Create a new message instance.
*
* @param \App\Wallet $wallet A wallet
* @param \App\User $user An email recipient
*
* @return void
*/
public function __construct(Wallet $wallet, User $user)
{
$this->wallet = $wallet;
$this->user = $user;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
$threshold = WalletCheck::threshold($this->wallet, WalletCheck::THRESHOLD_DELETE);
$subject = \trans('mail.negativebalancesuspended-subject', ['site' => \config('app.name')]);
$this->view('emails.html.negative_balance_suspended')
->text('emails.plain.negative_balance_suspended')
->subject($subject)
->with([
'site' => \config('app.name'),
'subject' => $subject,
'username' => $this->user->name(true),
'supportUrl' => \config('app.support_url'),
'walletUrl' => Utils::serviceUrl('/wallet'),
'date' => $threshold->toDateString(),
]);
return $this;
}
/**
* Render the mail template with fake data
*
* @param string $type Output format ('html' or 'text')
*
* @return string HTML or Plain Text output
*/
public static function fakeRender(string $type = 'html'): string
{
$wallet = new Wallet();
$user = new User();
$mail = new self($wallet, $user);
return Helper::render($mail, $type);
}
}

File Metadata

Mime Type
text/x-php
Expires
Mon, Apr 6, 1:26 AM (2 d, 10 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18825035
Default Alt Text
NegativeBalanceSuspended.php (2 KB)

Event Timeline