While Invoices generate, and staff resend a failed invoice/mail at the same time, all of those emails that went out received the correct email header and body but the wrong content in the attachment.
I noticed that the datetime fields of those emails in the log_emails table with the wrong attachment sent out have exactly the same date datetime on the second.
So from now on we will not resubmit mails manually for invoices that we create while the system is busy generating e.g. month-end invoices.
I did not look at the programming, but would suggest that a client id or user id be incorporated while generating the temporary pdf record. If that is the problem?
Kind regards
Chris