Merge pull request #6070 from turbo124/v5-develop

Fixes for BCC list
This commit is contained in:
David Bomba 2021-06-17 21:56:10 +10:00 committed by GitHub
commit c02538cd50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 6 deletions

View File

@ -152,8 +152,8 @@ class CompanySettings extends BaseSettings
public $email_sending_method = 'default'; //enum 'default','gmail' //@implemented
public $gmail_sending_user_id = '0'; //@implemented
public $reply_to_email = ''; //@TODO
public $reply_to_name = ''; //@TODO
public $reply_to_email = ''; //@implemented
public $reply_to_name = ''; //@implemented
public $bcc_email = ''; //@TODO
public $pdf_email_attachment = false; //@implemented
public $ubl_email_attachment = false; //@implemented

View File

@ -98,11 +98,17 @@ class NinjaMailerJob implements ShouldQueue
$this->nmo->mailable->replyTo($this->company->owner()->email, $this->company->owner()->present()->name());
}
$this->nmo->mailable->bcc('poop@gmail.com', 'hi');
$bcc_list = [];
if (strlen($this->nmo->settings->bcc_email) > 1) {
$this->nmo->mailable->bcc(explode(",", $this->nmo->settings->bcc_email));
foreach(explode(",", $this->nmo->settings->bcc_email) as $bcc){
$bcc_list[] = [$bcc, 'Blind Copy'];
}
// $this->nmo->mailable->bcc($bcc_list);
}
@ -112,6 +118,7 @@ class NinjaMailerJob implements ShouldQueue
Mail::mailer($this->mailer)
->to($this->nmo->to_user->email)
->bcc($bcc_list)
->send($this->nmo->mailable);
LightLogs::create(new EmailSuccess($this->nmo->company->company_key))

View File

@ -80,9 +80,6 @@ class TemplateEmail extends Mailable
$this->from(config('mail.from.address'), $this->company->present()->name());
// if (strlen($settings->bcc_email) > 1)
// $this->bcc(explode(",",$settings->bcc_email), 'BCC');
$this->subject($this->build_email->getSubject())
->text('email.template.plain', [
'body' => $this->build_email->getBody(),