Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions source/campaigns/editor/filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,8 @@ This example can be used in ``Email sending condition`` of Advocate Offer Email
qr\_code
........

Converts a string into a QR code image in SVG format.
Converts a string into a QR code. By default, produces an image in SVG format. If ``png_base64`` format is specified,
returns a source for an HTML element, containing a base64-encoded PNG image.

.. code-block:: liquid

Expand All @@ -1006,7 +1007,8 @@ Converts a string into a QR code image in SVG format.

It may take the following arguments:

* ``xdim`` - the width of the narrowest bar in a barcode. Thicker bars are multiples of the xdim. Default value is ``4``.
* ``xdim`` - the width of the cell in a QR code. Default value is ``4``.
* ``format`` - custom format for the result. Only ``png_base64`` is supported.

This filter generates a QR code that can be used to encode URLs, text, or coupon codes. The QR code is returned as an SVG image that can be directly embedded in HTML.

Expand All @@ -1018,6 +1020,12 @@ This filter generates a QR code that can be used to encode URLs, text, or coupon
{{ coupon.code | qr_code: xdim: 6 }}
</div>

To return a QR code as a base64-encoded PNG that can be embedded in email body, use the custom format:

.. code-block:: liquid

<img src="{{ coupon.code | qr_code: format: 'png_base64' }}" />

|hr|

rand\_by
Expand Down