Skip to content

Commit

Permalink
Merge pull request #3067 from CihanSenturk/Add-confidential-email-(bc…
Browse files Browse the repository at this point in the history
…c)-sending-feature

Add confidential email (bcc) sending feature
  • Loading branch information
cuneytsenturk committed Oct 15, 2023
2 parents 539cc91 + 32ef8ce commit e83476c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions app/Abstracts/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ public function initMailMessage(): MailMessage
if (!empty($this->custom_mail['cc'])) {
$message->cc($this->custom_mail['cc']);
}

if (!empty($this->custom_mail['bcc'])) {
$message->bcc($this->custom_mail['bcc']);
}

return $message;
}
Expand Down
6 changes: 3 additions & 3 deletions app/Jobs/Banking/SendTransactionAsCustomMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function handle(): void
$mail_request = $this->request->only(['to', 'subject', 'body']);

if ($this->request->get('user_email', false)) {
$mail_request['cc'] = user()->email;
$mail_request['bcc'] = user()->email;
}

$attachments = collect($this->request->get('attachments', []))
Expand All @@ -52,8 +52,8 @@ public function handle(): void
'body' => $mail_request['body'],
];

if (($counter == 1) && ! empty($mail_request['cc'])) {
$custom_mail['cc'] = $mail_request['cc'];
if (($counter == 1) && ! empty($mail_request['bcc'])) {
$custom_mail['bcc'] = $mail_request['bcc'];
}

$contact->notify(new Notification($transaction, $this->template_alias, $attach_pdf, $custom_mail, $attachments));
Expand Down
6 changes: 3 additions & 3 deletions app/Jobs/Document/SendDocumentAsCustomMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function handle(): void
$mail_request = $this->request->only(['to', 'subject', 'body']);

if ($this->request->get('user_email', false)) {
$mail_request['cc'] = user()->email;
$mail_request['bcc'] = user()->email;
}

$attachments = collect($this->request->get('attachments', []))
Expand All @@ -53,8 +53,8 @@ public function handle(): void
'body' => $mail_request['body'],
];

if (($counter == 1) && ! empty($mail_request['cc'])) {
$custom_mail['cc'] = $mail_request['cc'];
if (($counter == 1) && ! empty($mail_request['bcc'])) {
$custom_mail['bcc'] = $mail_request['bcc'];
}

$contact->notify(new $notification($document, $this->template_alias, $attach_pdf, $custom_mail, $attachments));
Expand Down

0 comments on commit e83476c

Please sign in to comment.