mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 11:04:41 -04:00
Ensure BCC email is only sent for the first contact
This commit is contained in:
parent
9b58a62b69
commit
0fdd7fce1e
@ -110,8 +110,10 @@ class ContactMailer extends Mailer
|
||||
}
|
||||
}
|
||||
|
||||
$isFirst = true;
|
||||
foreach ($invoice->invitations as $invitation) {
|
||||
$response = $this->sendInvitation($invitation, $invoice, $emailTemplate, $emailSubject, $pdfString, $documentStrings, $reminder);
|
||||
$response = $this->sendInvitation($invitation, $invoice, $emailTemplate, $emailSubject, $pdfString, $documentStrings, $reminder, $isFirst);
|
||||
$isFirst = false;
|
||||
if ($response === true) {
|
||||
$sent = true;
|
||||
}
|
||||
@ -147,7 +149,8 @@ class ContactMailer extends Mailer
|
||||
$subject,
|
||||
$pdfString,
|
||||
$documentStrings,
|
||||
$reminder
|
||||
$reminder,
|
||||
$isFirst
|
||||
)
|
||||
{
|
||||
|
||||
@ -203,7 +206,7 @@ class ContactMailer extends Mailer
|
||||
'invoice' => $invoice,
|
||||
'documents' => $documentStrings,
|
||||
'notes' => $reminder,
|
||||
'bccEmail' => $account->getBccEmail(),
|
||||
'bccEmail' => $isFirst ? $account->getBccEmail() : false,
|
||||
'fromEmail' => $account->getFromEmail(),
|
||||
];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user