Manual mails can be sent
This commit is contained in:
59
app/Mail/ManualMails/ManualMailsCommonMail.php
Normal file
59
app/Mail/ManualMails/ManualMailsCommonMail.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail\ManualMails;
|
||||
|
||||
use App\Models\Event;
|
||||
use App\Models\EventParticipant;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Attachment;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
|
||||
class ManualMailsCommonMail extends Mailable {
|
||||
public function __construct(
|
||||
private string $mailSubject,
|
||||
private string $message,
|
||||
private array $event,
|
||||
|
||||
)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message envelope.
|
||||
*/
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: $this->mailSubject,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message content definition.
|
||||
*/
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(
|
||||
view: 'emails.events.manual_mail',
|
||||
with: [
|
||||
'mailMessage' => ($this->message),
|
||||
'eventTitle' => $this->event['name'],
|
||||
'eventEmail' => $this->event['email'],
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the attachments for the message.
|
||||
*
|
||||
* @return array<int, Attachment>
|
||||
*/
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
62
app/Mail/ManualMails/ManualMailsReportMail.php
Normal file
62
app/Mail/ManualMails/ManualMailsReportMail.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail\ManualMails;
|
||||
|
||||
use App\Models\Event;
|
||||
use App\Models\EventParticipant;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Attachment;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
|
||||
class ManualMailsReportMail extends Mailable {
|
||||
public function __construct(
|
||||
private string $mailSubject,
|
||||
private string $message,
|
||||
private array $event,
|
||||
private array $originalRecipients,
|
||||
|
||||
)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message envelope.
|
||||
*/
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: $this->mailSubject,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message content definition.
|
||||
*/
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(
|
||||
view: 'emails.events.manual_mail_report',
|
||||
with: [
|
||||
'mailMessage' => ($this->message),
|
||||
'eventTitle' => $this->event['name'],
|
||||
'eventEmail' => $this->event['email'],
|
||||
'recipients' => implode('<br />', $this->originalRecipients),
|
||||
'countRecipients' => count($this->originalRecipients),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the attachments for the message.
|
||||
*
|
||||
* @return array<int, Attachment>
|
||||
*/
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user