Payment received email template reusing first contact name for multiple contacts

Version - v5.11.8

Environment - Shared Hosting

Checklist

  • Can you replicate the issue on our v5 demo site https://demo.invoiceninja.com or Invoice Ninja? No, as in regards to this issue I would need to link active email accounts to properly debug how they are received.
  • Have you searched existing issues? Yes, could not find anything.
  • Have you inspected the logs in storage/logs/laravel.log for any errors? Yes, nothing related.

Describe the bug

I have a client with multiple contacts for invoices/notifications to be sent to, and I have my payment email template set in the body to display <h1>Thanks $contact.first_name!</h1>.

When marking an invoice as paid, the emails sent out to each contact usually return the value corresponding to each individual contact name, but since updating to v5.11.8, it only returns the value of the first client email sent. So for example if ‘Bill’ is the first contact to be sent out it displays correctly, but each following email for the other contacts sends to the correct email address, but would display the name in the email body as ‘Bill’ again.

I am able to see how these emails are displaying as I BCC myself in.

It should also be noted that this issue does not occur for invoice notification emails, the same shortcode/token is used (<h1>Hi $contact.first_name!</h1>) and it returns each client name correctly in that instance.

Steps To Reproduce

  • Create recurring invoice with multiple contacts
  • Send/generate first invoice instance
  • Mark invoice as paid, with send payment email enabled (and set as global default).

Expected Behavior

  • Payment emails are sent out, with the shortcode/token returning the correct corresponding client name in the email body, rather than repeating the name from the first email sent.

Hi,

I suggest asking about this in a discussion on GitHub.

No worries, reposted here.

1 Like