79 lines
No EOL
2.5 KiB
PHP
79 lines
No EOL
2.5 KiB
PHP
<?php
|
|
namespace App\Mail;
|
|
|
|
use App\User;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use App\Services\Util;
|
|
|
|
class MailCheckout extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
public $txaction;
|
|
public $shopping_order;
|
|
public $shopping_payment;
|
|
protected $send_link;
|
|
|
|
public $subject;
|
|
public $data;
|
|
|
|
|
|
public function __construct($txaction, $shopping_order, $shopping_payment, $send_link)
|
|
{
|
|
$this->txaction = $txaction;
|
|
$this->shopping_order = $shopping_order;
|
|
$this->shopping_payment = $shopping_payment;
|
|
$this->send_link = $send_link;
|
|
|
|
$this->subject = __('email.checkout_subject')." mivita.care";
|
|
if($shopping_order->user_shop){
|
|
$this->subject = __('email.checkout_subject')." ".$shopping_order->user_shop->slug.'.mivita.care';
|
|
}
|
|
}
|
|
|
|
|
|
public function build()
|
|
{
|
|
$salutation = __('email.salutation').",";
|
|
|
|
if($this->shopping_order->shopping_user){
|
|
$salutation = __('email.hello')." ".$this->shopping_order->shopping_user->billing_firstname.",";
|
|
//make Adresse
|
|
}
|
|
if($this->txaction === 'paid'){
|
|
|
|
|
|
if($this->send_link){
|
|
|
|
}
|
|
return $this->view('emails.checkout')->with([
|
|
'salutation' => $salutation,
|
|
'copy1line' => __('email.checkout_copy1line'),
|
|
'shopping_order' => $this->shopping_order,
|
|
'shopping_payment' => $this->shopping_payment,
|
|
'copy3line' => __('email.checkout_copy3line'),
|
|
'greetings' => __('email.greetings'),
|
|
'sender' => __('email.sender'),
|
|
'send_link' => $this->send_link,
|
|
'url' => Util::getMyMivitaUrl(),
|
|
'button' => Util::getMyMivitaUrl(false),
|
|
]);
|
|
}else{
|
|
return $this->view('emails.checkout_status')->with([
|
|
'salutation' => $salutation,
|
|
'copy1line' => __('email.status_copy1line'),
|
|
'txactionn' => $this->txaction,
|
|
'shopping_order' => $this->shopping_order,
|
|
'shopping_payment' => $this->shopping_payment,
|
|
'copy3line' => __('email.checkout_copy3line'),
|
|
'greetings' => __('email.greetings'),
|
|
'sender' => __('email.sender'),
|
|
'send_link' => false,
|
|
]);
|
|
}
|
|
|
|
}
|
|
} |