mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Ensure BCC email is only sent for the first contact
This commit is contained in:
parent
1a5c353d13
commit
ca72473b7c
@ -91,8 +91,10 @@ class ContactMailer extends Mailer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$isFirst = true;
|
||||||
foreach ($invoice->invitations as $invitation) {
|
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) {
|
if ($response === true) {
|
||||||
$sent = true;
|
$sent = true;
|
||||||
}
|
}
|
||||||
@ -131,7 +133,8 @@ class ContactMailer extends Mailer
|
|||||||
$subject,
|
$subject,
|
||||||
$pdfString,
|
$pdfString,
|
||||||
$documentStrings,
|
$documentStrings,
|
||||||
$reminder
|
$reminder,
|
||||||
|
$isFirst
|
||||||
) {
|
) {
|
||||||
$client = $invoice->client;
|
$client = $invoice->client;
|
||||||
$account = $invoice->account;
|
$account = $invoice->account;
|
||||||
@ -185,7 +188,7 @@ class ContactMailer extends Mailer
|
|||||||
'invoice' => $invoice,
|
'invoice' => $invoice,
|
||||||
'documents' => $documentStrings,
|
'documents' => $documentStrings,
|
||||||
'notes' => $reminder,
|
'notes' => $reminder,
|
||||||
'bccEmail' => $account->getBccEmail(),
|
'bccEmail' => $isFirst ? $account->getBccEmail() : false,
|
||||||
'fromEmail' => $account->getFromEmail(),
|
'fromEmail' => $account->getFromEmail(),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user