Skip to main content

Send an e-invoice by email

This guide creates an XRechnung whenever a sales invoice is posted and sends it to the customer by email. It uses an E-Document Service without a service integration, so Business Central itself sends nothing – the flow does.

Before you start​

Build the flow​

  1. Create a flow with a trigger on the posted sales invoice, for example a record trigger on the Sales Invoice Header table.
  2. Add Create E-Document. Set Record to the trigger record and E-Document Service to your XRechnung service.
  3. Add a Send Email step. Fill in the recipient – for example the customer's email address from the invoice – a subject and a text, and attach the Document output of the previous step.
  4. Publish the flow.

Try it​

Post a sales invoice for a customer. The flow creates the XRechnung, and the customer receives the email with the XML file attached. In Business Central, the document is listed as an E-Document, so you can look it up there.

Variations​

  • To send the e-invoice through your e-document provider instead of by email, pick a service with a service integration. The step then creates and sends, and you can drop the Send Email step.
  • For a credit memo, use a flow on the posted sales credit memo the same way.
  • For ZUGFeRD, pick a ZUGFeRD service and fill in the Report, Report Parameters and Layout fields; the attachment is then a PDF.