Editja

Ixxerja permezz ta’


Add a QR code or barcode to transactional and receipt emails

Note

The Retail Interest Group by Dynamics 365 Commerce has moved from Yammer to Viva Engage. If you don't have access to the new Viva Engage community, fill out this form (https://aka.ms/JoinD365commerceVivaEngageCommunity) to be added and stay engaged in the latest discussions.

This article explains how to insert QR codes and barcodes that represent order IDs into transactional and receipt emails in Microsoft Dynamics 365 Commerce.

You can easily include QR codes and barcodes in transactional emails to help speed up the order lookup process in a retail environment. To insert QR codes and barcodes into emails, use an HTML <img> tag that requests a QR code or barcode image from a generation and rendering service. Microsoft doesn't provide this service. However, many free or inexpensive services can serve QR codes or barcodes that are dynamically generated based on a value that you pass in a query string.

Add a QR code or barcode to a transactional email

To insert a QR code or barcode into a transactional email that you send as part of an e-commerce purchase, follow these steps:

  1. Open the source HTML for the transactional email template, and add an HTML <img> tag that points to your QR code or barcode service. Here's an example.

    <img src="https://YOUR_QR_CODE_BAR_CODE_SERVICE?data=%salesid%&param1=value1&param2=value2" alt="%salesid%" />
    

    Here's an explanation of the preceding example:

    • YOUR_QR_CODE_BAR_CODE_SERVICE represents the domain of your QR code or barcode service.

    • data represents the parameter that the QR code or barcode service uses to receive the content that it should render as a QR code or barcode.

      Assign the value %salesid% to this parameter. In this example, the value is also used as alt text for the image.

    • param1 and param2 represent additional optional parameters.

  2. Go to Retail and Commerce > Headquarters setup > Parameters > Organization email templates, and upload the updated HTML to the appropriate transactional email template.

Note

Parameters might differ among QR code and barcode service providers. Therefore, be sure to contact your service provider to confirm the parameters that you must assign values to.

Add a QR code or barcode to a receipt email

To insert a QR code or barcode into a receipt email that can be sent after a purchase is made at the point of sale (POS), follow these steps:

  1. Open the source HTML for the receipt email template. Add an HTML <img> tag that points to your QR code or barcode service. Here's an example:

    <img src="https://YOUR_QR_CODE_BAR_CODE_SERVICE?data=%receiptid%&param1=value1&param2=value2" alt="%receiptid%" />
    

    Here's an explanation of the preceding example:

    • YOUR_QR_CODE_BAR_CODE_SERVICE represents the domain of your QR code or barcode service.

    • data represents the parameter that the QR code or barcode service uses to receive the content that it should render as a QR code or barcode.

      The value %receiptid% must be assigned to this parameter. In this example, notice that the value is also used as alt text for the image.

    • param1 and param2 represent additional optional parameters.

  2. Go to Retail and Commerce > Headquarters setup > Parameters > Organization email templates, and upload the updated HTML to the email template that has the email ID emailrecpt.

Note

Parameters might differ among QR code and barcode service providers. Therefore, be sure to contact your service provider to confirm the parameters that you must assign values to.

Additional resources

Send email receipts from Store Commerce

Create email templates for transactional events