first change

This commit is contained in:
2025-07-27 17:40:56 +05:45
commit f8b9a6725b
3152 changed files with 229528 additions and 0 deletions

View File

@@ -0,0 +1,73 @@
<?php
namespace Modules\Template\Emails;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Attachment;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class SendMail extends Mailable implements ShouldQueue
{
use Queueable, SerializesModels;
public $data;
/**
* Create a new message instance.
*/
public function __construct($data)
{
$this->data = $data;
}
/**
* Build the message.
*/
// public function build(): self
// {
// return $this->view('mail.template');
// }
public function envelope(): Envelope
{
return new Envelope(
subject: $this->data['subject'],
);
}
/**
* Get the message content definition.
*/
public function content(): Content
{
return new Content(
view: 'mail.template'
);
}
// /**
// * Get the attachments for the message.
// *
// * @return array
// */
public function attachments(): array
{
$attachments = [];
if (isset($this->data['documentPaths'])) {
foreach ($this->data['documentPaths'] as $path) {
$attachments[] = Attachment::fromPath($path);
}
}
if (isset($this->data['mergePdf'])) {
$attachments[] = Attachment::fromPath($this->data['mergePdf']);
}
return $attachments;
}
}