Skip to content

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

Description

@arifainchtein

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions