Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploading a pdf and making it the sales invoice to be included in the email to customer #337

Open
arifainchtein opened this issue Apr 17, 2023 · 0 comments

Comments

@arifainchtein
Copy link

SDK you're using (please complete the following information):
4.14

Describe the bug
I have created an invoice and uploaded a pdf as an attachment. This pdf represent the sales invoice that i want to mail to the client.
However, when i click on the send email button and i send the email with the sales invoce, the one that is sent in the email is not the one i uploaded. but one created by xero using a different template. How can a an attachment to an invoice and mark it to be the pdf is to be included in the email sent to the customer?

To Reproduce
Here is the code i use to upload the attachemtn:

Invoice newinvoice = result.getInvoices().get(0); logger.debug("line 462, returning invoice=" + newinvoice.toString()); UUID invoiceid = newinvoice.getInvoiceID(); Invoices retinvoices = accountingApi.getInvoice(access_token, xero_tenant_id, invoiceid, null); //logger.debug("line 448, returning invoice=" + retinvoices.getInvoices().get(0).getAmountDue()); String basename= FilenameUtils.getName(filename); logger.debug("line 447, invoice created for customerorder " + customerorderid + " invoiceid=" + invoiceid + " basename=" + basename);
		accountingApi.createInvoiceAttachmentByFileName(access_token, xero_tenant_id, invoiceid,basename, invoicePDFFile, includeonline);

Expected behavior
The uploaded pdf becomes the sale invoice pdf emailed to a client

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant