Page MenuHomePhorge

PaymentSuccess.php
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

PaymentSuccess.php

<?php
namespace App\Mail;
use App\Payment;
use App\Tenant;
use App\User;
use App\Utils;
use App\Wallet;
class PaymentSuccess extends Mailable
{
/** @var Payment A payment operation */
protected $payment;
/**
* Create a new message instance.
*
* @param Payment $payment A payment operation
* @param User $user A wallet controller to whom the email is being sent
*/
public function __construct(Payment $payment, User $user)
{
$this->payment = $payment;
$this->user = $user;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
$appName = Tenant::getConfig($this->user->tenant_id, 'app.name');
$supportUrl = Tenant::getConfig($this->user->tenant_id, 'app.support_url');
$vars = [
'email' => $this->payment->wallet->owner->email,
'name' => $this->user->name(true),
'site' => $appName,
];
$this->view('emails.html.payment_success')
->text('emails.plain.payment_success')
->subject(\trans('mail.paymentsuccess-subject', $vars))
->with([
'vars' => $vars,
'walletUrl' => Utils::serviceUrl('/wallet', $this->user->tenant_id),
'supportUrl' => Utils::serviceUrl($supportUrl, $this->user->tenant_id),
]);
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
{
$user = new User([
'email' => 'test@' . \config('app.domain'),
]);
$payment = new Payment();
$payment->wallet = new Wallet();
$payment->wallet->owner = $user;
$mail = new self($payment, $user);
return Helper::render($mail, $type);
}
}

File Metadata

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

Event Timeline