Articles on: Dynamics 365 & Business Central

One-Click Invoice PDF Emailer for Dynamics 365 Sales

End-user and admin guide

What it does


One-Click Invoice PDF Emailer helps you generate a PDF from a Dynamics 365 Sales invoice template and email it to your customer directly from the Invoice record—using a single Approve & Send action. Optional internal CC recipients can be included automatically.


Who this is for


  • End users (Sales / Finance): approving an invoice and emailing the PDF to the customer.
  • Admins / Power Platform owners: installing the solution, configuring templates, sender/CCs, and enabling flows.


Key features


  • One-click “Approve & Send” button on Invoice
  • PDF generation from a Word template
  • Template selection per Account or Territory
  • Automatic email creation + PDF attachment
  • Optional internal CC recipients
  • Status updates so users can see progress (Approved → Sent)


Prerequisites


Required products



  • Dynamics 365 Sales (Dataverse)
  • Power Automate (cloud flows)


Required setup in your tenant


  • Mailbox / email sending must be configured for Dynamics 365/Dataverse Email to actually deliver email.
  • A Word template for Invoice must exist and be selectable for your process.
  • Power Automate licensing: this solution uses an HTTP-based call with Microsoft Entra ID to generate the PDF (this typically requires Premium capabilities in many tenants).


Admin setup (after installing the solution)


1) Configure environment settings

Open Solutions → One-Click Invoice PDF Emailer… → Environment variables and set:

  • Dynamics URI: your Dataverse org URL (for example, https://<org>.crm*.dynamics.com)
  • SenderEmailAddress: the internal user who should appear as the sender
  • InvoiceCCEmailAddress (optional): internal CC recipient #1
  • InvoiceCCEmailAddress2 (optional): internal CC recipient #2

Tip: Use real internal users that have a configured mailbox and permission to send email.


2) Create/verify connections (Connection References)

In the solution, open Connection references and ensure each one is connected in the target environment (as required by your flows). If prompted, create the connections and reselect them in the reference.


For the "HTTP with Microsoft Entra ID (preauthorized)" action, please fill in your Dynamics 365 URI as the Base Resource URL and Microsoft Entra ID Resource URI as in below screenshot:

Replace xxxx.crmx.dynamics.com with your actual Dynamics URI)



3) Turn on the flows

In the solution, turn on:

  • GenerateInvoicePDF (the main “generate + email” flow)
  • Scheduled – Refresh Document Template TempTable (keeps template mapping updated)


4) Verify the template sync ran successfully

The scheduled flow maintains a template lookup table used by Account/Territory template selection. After enabling it:

  • Run it once manually (recommended) and confirm it completes successfully.


5) Assign invoice templates (Account and/or Territory)

You can control which template is used by setting:

  • Account → Invoice Template (preferred), or
  • Territory → Invoice Template (fallback if Account doesn’t specify one)

Recommended approach:

  1. Set standard template(s) at the Territory level for consistency.
  2. Override at specific Accounts where needed.


6) Permissions and ownership (important)

Decide how you want the flow to run:

  • Owned by an admin/service user (most reliable): keep flows owned by a stable account with the right permissions and mailbox configuration.
  • Ensure end users have permissions to:
    • Read Invoice, Account, Contact, Territory
    • Create Email and Email attachments (Dataverse)
    • Trigger the action on the Invoice (button visibility + invoice update rights)


End-user instructions (how to send an invoice PDF)


Before you click Approve & Send

On the Invoice:

  • Confirm the Customer/Account is correct.
  • Confirm the Account has a Primary Contact with an email address (this is required to send).
  • Confirm the Invoice is ready to be approved and emailed.


Send the invoice PDF

  1. Open the Invoice record.
  2. Click Approve & Send.
  3. Confirm the prompt.


What happens next:

  • The invoice is marked Approved and queued.
  • The system generates a PDF using the configured template.
  • An Email is created and sent with the PDF attached.
  • The invoice status updates to Sent when complete.


Where to find the sent email

On the Invoice timeline (or related activities), you should see the created Email record and its attachment.


What users will see if something is missing


“Primary contact email is missing”

If the Account’s primary contact doesn’t have an email address, the send process will stop.

Fix:

  1. Open the Account.
  2. Set a Primary Contact (or open the current one).
  3. Ensure the Contact has a valid Email.
  4. Return to the Invoice and try Approve & Send again.


“No template found”

If no invoice template is set at the Account level and none is available at the Territory level, the process can’t generate the PDF.

Fix:

  • Ask your admin to set Invoice Template on the Account or Territory, then retry.


Troubleshooting checklist (admin-friendly)


Email didn’t arrive

  • Verify the Email activity shows as Sent (and not Pending/Failed).
  • Confirm mailbox/server-side sync configuration for the sender.
  • Confirm the sender user has permission to send and their mailbox is approved/configured.


PDF generation failed

  • Confirm the Invoice template exists and is valid for Invoice.
  • Confirm the scheduled template refresh flow has run successfully.
  • Confirm the HTTP/Entra ID connection is created and allowed by tenant DLP policies.


Button does nothing / errors immediately

  • Confirm the user has permissions to update the Invoice.
  • Confirm the web resource/command bar customization is present and published.
  • Confirm the main flow is turned on and not suspended.


FAQ


Can we change the sender or CC recipients?

Yes. Update the environment settings (SenderEmailAddress / CC variables). The next email will use the new values.


Can we use different templates for different customers?

Yes. Set an Invoice Template on the Account. If not set, the Territory template can be used as a fallback.


Does this store PDFs outside Dynamics 365?

The PDF is generated and attached to a Dataverse Email. The solution also uses an authenticated call to Dataverse to generate the PDF.


Support

If you need help with installation, configuration, or troubleshooting, contact your internal admin or your solution provider’s support channel.

Updated on: 01/04/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!