#51 Festschreiben der Points, Gutschriftenmodul
This commit is contained in:
parent
dfd049aaa9
commit
3f2fbd6d5b
63 changed files with 4610 additions and 971 deletions
54
app/Mail/MailCredit.php
Normal file
54
app/Mail/MailCredit.php
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
namespace App\Mail;
|
||||
|
||||
use Storage;
|
||||
use App\User;
|
||||
use App\Services\Credit;
|
||||
use App\Services\Invoice;
|
||||
use App\Models\UserCredit;
|
||||
use App\Models\ShoppingOrder;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
||||
class MailCredit extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
protected $user_credit;
|
||||
|
||||
public $subject;
|
||||
|
||||
|
||||
public function __construct(UserCredit $user_credit)
|
||||
{
|
||||
$this->user_credit = $user_credit;
|
||||
$this->subject = 'Deine Gutschrift auf mivita.care';
|
||||
}
|
||||
|
||||
public function build()
|
||||
{
|
||||
$title = __('email.credit_title');
|
||||
$copy1line = __('email.credit_copy1line');
|
||||
|
||||
$filename = $this->user_credit->filename;
|
||||
$disk = $this->user_credit->disk;
|
||||
$path = $this->user_credit->getDownloadPath();
|
||||
|
||||
if (!Storage::disk($disk)->exists($path)) {
|
||||
return;
|
||||
}
|
||||
$file = Storage::disk($disk)->path($path);
|
||||
$file = str_replace('//', '/', $file);
|
||||
$mime = Storage::disk($disk)->mimeType($path);
|
||||
|
||||
return $this->view('emails.blank')->with([
|
||||
'title' => $title,
|
||||
'copy1line' => $copy1line,
|
||||
])->attach($file,[
|
||||
'as' => $filename,
|
||||
'mime' => $mime,
|
||||
]); // attach file;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue