mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 13:14:30 -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) {
|
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;
|
||||||
}
|
}
|
||||||
@ -147,7 +149,8 @@ class ContactMailer extends Mailer
|
|||||||
$subject,
|
$subject,
|
||||||
$pdfString,
|
$pdfString,
|
||||||
$documentStrings,
|
$documentStrings,
|
||||||
$reminder
|
$reminder,
|
||||||
|
$isFirst
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -203,7 +206,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