Skip to content

Commit

Permalink
Update Handler.php
Browse files Browse the repository at this point in the history
  • Loading branch information
techjewel committed Mar 15, 2024
1 parent 16e8cb6 commit 322cb83
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/Services/Mailer/Providers/Simulator/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ class Handler extends BaseHandler
public function send()
{
if($this->shouldBeLogged(true)) {
$this->setAttributes();
$atts = $this->setAttributes();

$customHeaders = $atts['custom_headers'];
$headers = $atts['headers'];
foreach ($customHeaders as $customHeader) {
$headers[$customHeader['key']] = $customHeader['value'];
}

$logData = [
'to' => maybe_serialize($this->setRecipientsArray($this->phpMailer->getToAddresses())),
'from' => maybe_serialize($this->phpMailer->From),
Expand All @@ -19,7 +26,7 @@ public function send()
'attachments' => maybe_serialize($this->phpMailer->getAttachments()),
'status' => 'sent',
'response' => maybe_serialize(['status' => 'Email sending was simulated, No Email was sent originally']),
'headers' => maybe_serialize($this->phpMailer->getCustomHeaders()),
'headers' => maybe_serialize($headers),
'extra' => maybe_serialize(['provider' => 'Simulator'])
];
(new Logger)->add($logData);
Expand Down

0 comments on commit 322cb83

Please sign in to comment.