diff --git a/app/Jobs/Mail/NinjaMailerJob.php b/app/Jobs/Mail/NinjaMailerJob.php index d9c42a859c..6c9d0a374a 100644 --- a/app/Jobs/Mail/NinjaMailerJob.php +++ b/app/Jobs/Mail/NinjaMailerJob.php @@ -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)) diff --git a/app/Mail/TemplateEmail.php b/app/Mail/TemplateEmail.php index 5d7f2ccc45..4ba7bd5cd1 100644 --- a/app/Mail/TemplateEmail.php +++ b/app/Mail/TemplateEmail.php @@ -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; }