wip
This commit is contained in:
1 parent
78917241ad
commit
f098ba9b00
18 files changed
+499
-473
No files matched your search
@@ -8,7 +8,6 @@ use Illuminate\Mail\Mailables\Attachment;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Console\Commands\Grapper\Sofascore;
|
||||
|
||||
class SofaScoreDataMail extends Mailable
|
||||
{
|
||||
@@ -17,13 +16,7 @@ class SofaScoreDataMail extends Mailable
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*/
|
||||
public function __construct(string $header, string $message)
|
||||
{
|
||||
$this->header = $header;
|
||||
$this->message = $message;
|
||||
$this->archive_name = Sofascore::$archive_name;
|
||||
$this->zip_file = Sofascore::$storage . Sofascore::$archive_name;
|
||||
}
|
||||
public function __construct(public string $header, public string $table, public array $sendfiles) {}
|
||||
|
||||
/**
|
||||
* Get the message envelope.
|
||||
@@ -43,7 +36,8 @@ class SofaScoreDataMail extends Mailable
|
||||
return new Content(
|
||||
markdown: 'mail.user.sofascore_data',
|
||||
with: [
|
||||
'message' => $this->message,
|
||||
'message' => $this->header,
|
||||
'table' => $this->table,
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -52,13 +46,16 @@ class SofaScoreDataMail extends Mailable
|
||||
* Get the attachments for the message.
|
||||
*
|
||||
* @return array<int, Attachment>
|
||||
* ->withMime('application/x-zip-compressed');
|
||||
*/
|
||||
public function attachments(): array
|
||||
{
|
||||
return [
|
||||
Attachment::fromPath($this->zip_file)
|
||||
->as($this->archive_name)
|
||||
->withMime('application/x-zip-compressed')
|
||||
];
|
||||
$attachments = [];
|
||||
foreach ($this->sendfiles as $sendfile) {
|
||||
$attachments[] = Attachment::fromPath($sendfile)
|
||||
->withMime('application/vnd.openxmlformats-officedocument.spreadsheetml.template');
|
||||
}
|
||||
|
||||
return $attachments;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user