1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Merge pull request #6073 from turbo124/v5-develop

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

View File

@ -98,24 +98,12 @@ 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) {
$bcc_list = explode(",", $this->nmo->settings->bcc_email);
}
//send email
try {
nlog("trying to send to {$this->nmo->to_user->email} ". now()->toDateTimeString());
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,6 +80,9 @@ 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));
$this->subject($this->build_email->getSubject())
->text('email.template.plain', [
'body' => $this->build_email->getBody(),
@ -105,9 +108,6 @@ class TemplateEmail extends Mailable
$message->invitation = $this->invitation;
});
//conditionally attach files
// if ($settings->pdf_email_attachment !== false && ! empty($this->build_email->getAttachments())) {
//hosted | plan check here
foreach ($this->build_email->getAttachments() as $file) {
@ -117,7 +117,6 @@ class TemplateEmail extends Mailable
$this->attach($file['path'], ['as' => $file['name'], 'mime' => $file['mime']]);
}
// }
return $this;
}