mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 14:27:29 -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) { | ||||
|             $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; | ||||
|             } | ||||
| @ -131,7 +133,8 @@ class ContactMailer extends Mailer | ||||
|         $subject, | ||||
|         $pdfString, | ||||
|         $documentStrings, | ||||
|         $reminder | ||||
|         $reminder, | ||||
|         $isFirst | ||||
|     ) { | ||||
|         $client = $invoice->client; | ||||
|         $account = $invoice->account; | ||||
| @ -185,7 +188,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