36 lines
825 B
PHP
36 lines
825 B
PHP
<?php
|
|
|
|
namespace App\Traits\Sofascore;
|
|
|
|
use App\Mail\SofaScoreDataMail;
|
|
use App\Utilities\Notice;
|
|
use Illuminate\Support\Carbon;
|
|
use Illuminate\Support\Facades\Mail;
|
|
|
|
trait GrappingMail
|
|
{
|
|
public function send(string $folder)
|
|
{
|
|
ini_set('memory_limit', -1);
|
|
|
|
if ($this->debug) {
|
|
Notice::note("Mail Excel: $folder", 'b');
|
|
}
|
|
|
|
$files = $this->get_tree($this->data_dir);
|
|
|
|
$sendfiles = $this->filter($files, ['xlsx']);
|
|
|
|
$header = ucfirst($folder).' '.Carbon::now()->format('Y-m-d');
|
|
|
|
Mail::to('hermann.telser@gmail.com')
|
|
->cc('ubaldo.perrucci@gmail.com')
|
|
->send(
|
|
new SofaScoreDataMail($header, $sendfiles)
|
|
);
|
|
if ($this->debug) {
|
|
Notice::note('✉ Mail Send', 'bg');
|
|
}
|
|
}
|
|
}
|