Changeset View
Changeset View
Standalone View
Standalone View
src/app/Mail/NegativeBalance.php
Show All 34 Lines | class NegativeBalance extends Mailable | ||||
* @return $this | * @return $this | ||||
*/ | */ | ||||
public function build() | public function build() | ||||
{ | { | ||||
$user = $this->account; | $user = $this->account; | ||||
$subject = \trans('mail.negativebalance-subject', ['site' => \config('app.name')]); | $subject = \trans('mail.negativebalance-subject', ['site' => \config('app.name')]); | ||||
$this->view('emails.negative_balance') | $this->view('emails.html.negative_balance') | ||||
->text('emails.plain.negative_balance') | |||||
->subject($subject) | ->subject($subject) | ||||
->with([ | ->with([ | ||||
'site' => \config('app.name'), | 'site' => \config('app.name'), | ||||
'subject' => $subject, | 'subject' => $subject, | ||||
'username' => $user->name(true), | 'username' => $user->name(true), | ||||
'supportUrl' => \config('app.support_url'), | 'supportUrl' => \config('app.support_url'), | ||||
'walletUrl' => Utils::serviceUrl('/wallet'), | 'walletUrl' => Utils::serviceUrl('/wallet'), | ||||
]); | ]); | ||||
return $this; | return $this; | ||||
} | } | ||||
/** | /** | ||||
* Render the mail template with fake data | * Render the mail template with fake data | ||||
* | * | ||||
* @return string HTML output | * @param string $type Output format ('html' or 'text') | ||||
* | |||||
* @return string HTML or Plain Text output | |||||
*/ | */ | ||||
public static function fakeRender(): string | public static function fakeRender(string $type = 'html'): string | ||||
{ | { | ||||
$user = new User(); | $user = new User(); | ||||
$mail = new self($user); | $mail = new self($user); | ||||
return $mail->build()->render(); | return Helper::render($mail, $type); | ||||
} | } | ||||
} | } |