Email Delivery and Notifications

Send documents via email alongside or instead of Peppol, and configure email notifications for incoming and outgoing documents.

This guide covers the two ways email is used in Recommand: delivering documents to recipients via email, and sending notifications about document activity to your team.

Email Delivery

Recommand uses a single API endpoint for sending all your documents, whether the recipient is on Peppol or not. You can include email delivery alongside Peppol, as a fallback when Peppol fails, or as the sole delivery method for recipients who aren't on the Peppol network.

Common use cases:

  • B2C customers who aren't on the Peppol network
  • Business customers who need a structured e-invoice but aren't on the Peppol network, such as many German businesses (see Structured documents by email)
  • International recipients outside countries with Peppol mandates
  • Fallback delivery when Peppol transmission fails
  • Additional delivery when you want both Peppol and email

How It Works

Add the email field to your send document request:

const response = await fetch(
  "https://app.recommand.eu/api/v1/{companyId}/send",
  {
    method: "POST",
    headers: {
      Authorization:
        "Basic " +
        Buffer.from("your_api_key:your_api_secret").toString("base64"),
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      recipient: "0208:987654321",
      documentType: "invoice",
      document: {
        // ... your invoice data
      },
      email: {
        when: "always",
        to: ["customer@example.com"],
      },
    }),
  },
);

Email Options

FieldDescriptionDefault
email.when"always" sends email regardless of the Peppol result. "on_peppol_failure" only sends email if Peppol delivery fails."on_peppol_failure"
email.toArray of recipient email addresses.Required
email.subjectCustom email subject line.Auto-generated from document type and number
email.htmlBodyCustom HTML body for the email.Auto-generated
email.replyToAddress that replies to the email go to.The issuer's email address from the document

Document emails are sent from Recommand's address, with the issuer's name from the document as the sender name. A recipient who replies reaches email.replyTo, or without it the issuer's email address as the document states it: the seller's contact email (seller.email), or the buyer's for self-billing documents. Set that address in the document or pass email.replyTo; otherwise replies go to Recommand's sending address, which is not monitored.

Sending Without a Peppol Recipient

For customers who aren't on the Peppol network, you can set recipient to null to send exclusively via email. This works with invoices, credit notes, self-billing invoices, and self-billing credit notes.

{
  recipient: null,
  documentType: "invoice",
  document: {
    // ... your invoice data
  },
  email: {
    to: ["customer@example.com"],
  },
  pdfGeneration: {
    enabled: true,
  },
}

When recipient is null, email becomes the primary delivery method and email.to is required. The when field is ignored since there is no Peppol delivery to fall back from.

For a JSON document without a doctypeId, these emails carry no XML, so the PDF attachment effectively becomes the document your recipient receives. You can either let Recommand generate a PDF from your document data, or attach your own custom PDF. See PDF Attachments below.

Structured Documents by Email

Some buyers need a structured e-invoice, not a PDF, even when they aren't on Peppol. German businesses are the main example: from 2027, or 2028 for smaller companies, their domestic B2B invoices have to be structured e-invoices, and an XRechnung or Peppol BIS XML delivered by email counts as one, while a PDF does not.

Set doctypeId on a send with recipient: null, and the document is written in that format, validated exactly as it would be for a Peppol recipient, stored with the document, and attached to the email as XML:

{
  recipient: null,
  documentType: "invoice",
  doctypeId:
    "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0::2.1",
  document: {
    // ... your invoice data
  },
  email: {
    to: ["rechnung@kunde.example"],
  },
  pdfGeneration: {
    enabled: true,
  },
}

A document that fails validation is refused with a 400 that lists the failing rules and fields, before any email is sent. Add processId if you need a process other than the default. Leave doctypeId out of a JSON document and nothing changes: the email carries the PDF only.

A structured invoice names the buyer's electronic address (BT-49). Without a Peppol recipient, Recommand takes it from the document, using the first that applies:

  1. The buyer's enterpriseNumber under its enterpriseNumberScheme.
  2. The buyer's vatNumber, under the Peppol VAT scheme of the country its prefix names, such as 9930 for a DE number. A number without its country prefix is a validation error.
  3. The first address in email.to, under scheme EM.

On a self-billing invoice or credit note the receiving party is the seller, so the seller's numbers are used.

Peppol BIS 3 does not accept an email address as electronic address. A Peppol BIS document is refused with a 400 when the buyer has no enterprise number and no VAT number that Peppol has a VAT scheme for (Danish, Finnish, Swedish and Icelandic VAT numbers have none). Add the enterprise number, or send XRechnung or CII, which accept the email address. French regulated documents cannot be delivered by email only: send them to a Peppol recipient.

If your software already writes its own invoices, send the XML as it is with documentType: "xml". It is validated, stored and attached to the email exactly as given, with any PDF embedded in it as a separate attachment. The document has to be an invoice, credit note, self-billing invoice or self-billing credit note in a format Recommand reads, and it carries its own electronic addresses:

{
  recipient: null,
  documentType: "xml",
  document: "<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\">...</Invoice>",
  email: {
    to: ["accounting@customer.example"],
  },
}

This means you can use a single API endpoint and document format for all your customers. Recommand handles the delivery method based on the recipient.

PDF Attachments

When sending documents via email, you can attach a PDF in two ways:

Auto-generated PDF. Recommand renders a PDF from your document data:

{
  pdfGeneration: {
    enabled: true,
    filename: "INV-2025-001.pdf", // optional custom filename
  },
}

Custom PDF. Include your own PDF via the document's attachments field. This is useful if you have a branded invoice template or generate PDFs in your own system. See the sending invoices guide for details on attachments.

Emails also include the XML document whenever one was written: on every send with a Peppol recipient, including fallback emails, and on a send without one when doctypeId is set.

Response

The send document response includes what the request sent and the delivery outcomes known when it returned. In this example, Peppol delivery is confirmed and email delivery is awaiting confirmation:

{
  "success": true,
  "teamId": "team_xxx",
  "companyId": "c_xxx",
  "id": "doc_xxx",
  "peppolMessageId": "message-123@example.com",
  "envelopeId": "envelope-123",
  "sentOverPeppol": true,
  "sentOverEmail": true,
  "emailRecipients": [
    "customer@example.com"
  ],
  "deliveryStatus": "delivered",
  "deliveries": [
    {
      "id": "dlv_peppol_123",
      "channel": "peppol",
      "address": "0208:0428643097",
      "status": "delivered",
      "statusChangedAt": "2026-09-14T20:00:00.000Z",
      "failure": null,
      "references": {
        "peppolMessageId": "message-123@example.com",
        "peppolConversationId": "conversation-123",
        "envelopeId": "envelope-123"
      }
    },
    {
      "id": "dlv_email_123",
      "channel": "email",
      "address": "customer@example.com",
      "status": "pending",
      "statusChangedAt": "2026-09-14T20:00:00.000Z",
      "failure": null,
      "references": {
        "messageId": "00000000-0000-0000-0000-000000000123"
      }
    }
  ]
}

sentOverPeppol, sentOverEmail and emailRecipients describe what the send request sent. success: true does not mean every delivery has been confirmed. Use deliveries and deliveryStatus in the send response and document endpoints to track the outcome. Here, the overall status is delivered because the Peppol attempt succeeded, even though the email attempt is still pending.

Tracking Delivery

Each entry in deliveries represents one attempt to one address over peppol or email:

  • pending: accepted for sending, awaiting an outcome.
  • delivered: the receiving Peppol access point or recipient's mail server accepted the document. This does not establish that a person read or approved it.
  • failed: the attempt failed. The failure object contains a category, message and provider code when available.

The document-level deliveryStatus is delivered if any attempt is delivered, failed if all attempts failed, and pending otherwise. It is null when there are no deliveries. Inspect individual attempts to detect a failed channel even when another succeeded. The document list supports deliveryStatus and deliveryFailed filters.

When the Peppol network says the recipient is not registered at all, Recommand does not attempt the transmission: the Peppol delivery fails with category recipient_not_found and email fallback, if configured, runs straight away with the XML attached. A lookup that fails for any other reason, such as an unreachable directory, does not count as not registered: the transmission is attempted as usual, and fallback only runs if that attempt fails.

With email.when: "on_peppol_failure", fallback also runs when the access point reports a failure after the send request returned. The resulting email attempts appear in deliveries when you fetch the document; sentOverEmail and emailRecipients in the original send response describe only what that request sent. A failed Peppol attempt is not automatically resent.

Subscribe to delivery status webhooks or use a Delivery status changed rule to receive later outcomes. document.sent reports acceptance and includes the status known at that time.

Emails sent before delivery tracking was introduced are backfilled as delivered from the historical send record. They have no message correlation for obtaining a later delivery confirmation.

Each email sent counts toward your document quota, including a fallback sent after a later Peppol failure. Status updates do not add another charge.

Email Notifications

Email notifications alert you (or your systems) when documents are sent or received. They are configured per company and can be set up from the dashboard or via the API.

What Notifications Include

Every notification email includes:

  • A summary of the document (type, number, amount, sender or recipient)
  • The original UBL XML as an attachment
  • Any attachments embedded in the original document

You can optionally include:

  • Auto-generated PDF: a visual PDF rendering of the UBL XML document, generated by Recommand
  • Document JSON: the structured JSON representation with metadata

Setting Up Notifications

Via the Dashboard

In the dashboard, navigate to your company and open the notification email settings. From there you can add email addresses and configure which notifications each address receives.

Via the API

Use the notification email address endpoints to manage notification emails programmatically.

Create a notification email address:

const response = await fetch(
  "https://app.recommand.eu/api/v1/companies/{companyId}/notification-email-addresses",
  {
    method: "POST",
    headers: {
      Authorization:
        "Basic " +
        Buffer.from("your_api_key:your_api_secret").toString("base64"),
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      email: "accounting@yourcompany.com",
      notifyIncoming: true,
      notifyOutgoing: false,
      includeAutoGeneratedPdfIncoming: true,
      includeDocumentJsonIncoming: false,
    }),
  },
);

Configuration Options

Each email address can be configured independently:

SettingDescription
notifyIncomingReceive notifications when documents are received
notifyOutgoingReceive notifications when documents are sent
includeAutoGeneratedPdfIncomingAttach a PDF rendering of the XML document for incoming documents
includeAutoGeneratedPdfOutgoingAttach a PDF rendering of the XML document for outgoing documents
includeDocumentJsonIncomingAttach the structured JSON for incoming documents
includeDocumentJsonOutgoingAttach the structured JSON for outgoing documents

At least one of notifyIncoming or notifyOutgoing must be enabled. You can add multiple email addresses per company, each with different settings.

Common Setups

Notify your team about incoming invoices:

{
  "email": "finance@yourcompany.com",
  "notifyIncoming": true,
  "notifyOutgoing": false,
  "includeAutoGeneratedPdfIncoming": true
}

Forward documents to accounting software:

Many accounting tools offer an email inbox that automatically processes incoming UBL/XML documents. Point a notification email at that inbox and documents flow from Peppol into your accounting software automatically, with no code required. See the setup guides for Exact Online, Yuki, and ClearFacts.

{
  "email": "inbox@accounting-tool.com",
  "notifyIncoming": true,
  "notifyOutgoing": false,
  "includeAutoGeneratedPdfIncoming": false,
  "includeDocumentJsonIncoming": false
}

The XML is always attached, which is all most accounting tools need. See the integrations page for all available setup guides.

Keep a copy of all outgoing documents:

{
  "email": "archive@yourcompany.com",
  "notifyIncoming": false,
  "notifyOutgoing": true,
  "includeAutoGeneratedPdfOutgoing": true,
  "includeDocumentJsonOutgoing": true
}

Managing Notification Emails

You can list, update, and delete notification email addresses through the API:

// List all notification emails for a company
const list = await fetch(
  "https://app.recommand.eu/api/v1/companies/{companyId}/notification-email-addresses",
  {
    headers: {
      Authorization:
        "Basic " +
        Buffer.from("your_api_key:your_api_secret").toString("base64"),
    },
  },
);

// Update settings
const update = await fetch(
  "https://app.recommand.eu/api/v1/companies/{companyId}/notification-email-addresses/{addressId}",
  {
    method: "PUT",
    headers: {
      Authorization:
        "Basic " +
        Buffer.from("your_api_key:your_api_secret").toString("base64"),
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      email: "accounting@yourcompany.com",
      notifyIncoming: true,
      notifyOutgoing: true,
      includeAutoGeneratedPdfIncoming: true,
      includeAutoGeneratedPdfOutgoing: false,
      includeDocumentJsonIncoming: false,
      includeDocumentJsonOutgoing: false,
    }),
  },
);

// Delete a notification email
const remove = await fetch(
  "https://app.recommand.eu/api/v1/companies/{companyId}/notification-email-addresses/{addressId}",
  {
    method: "DELETE",
    headers: {
      Authorization:
        "Basic " +
        Buffer.from("your_api_key:your_api_secret").toString("base64"),
    },
  },
);

Next Steps