An open API service indexing awesome lists of open source software.

https://github.com/typpo/mjml-qr-code

Embed QR codes in your emails
https://github.com/typpo/mjml-qr-code

Last synced: 11 months ago
JSON representation

Embed QR codes in your emails

Awesome Lists containing this project

README

          

# mjml-qr-code
[![npm](https://img.shields.io/npm/v/mjml-qr-code)](https://www.npmjs.com/package/mjml-qr-code)
[![Build Status](https://travis-ci.com/typpo/mjml-qr-code.svg?branch=master)](https://travis-ci.com/typpo/mjml-qr-code)

A component for adding QR codes to your email using an open-source [QuickChart](https://quickchart.io) provider.

## Usage

This mjml...

```html







```

Will show this QR code:

![QR code](https://quickchart.io/qr?text=hello%20world)

Customize the color, size, positioning, and other QR parameters using the attributes below.

## Setup

Install via npm:

```
npm install mjml-qr-code --save
```

Then add the package to your `.mjmlconfig`:

```
{
"packages": [
"mjml-qr-code/lib/MjQrCode.js"
]
}
```

## Attributes

The `` tag supports all the attributes of the `` tag. View those attributes [here](https://mjml.io/documentation/#mjml-image).

In addition to regular image attributes which you can using for sizing and positioning, the component supports the following QR-specific attributes:

| Name | Description | Required? | Default | |
|------------------------|-----------------------------------------------------------|-----------|----------------|---|
| value | The content encoded in your QR code | Yes | | |
| color | The color of the QR code | No | 000000 (black) | |
| background-color | The background of the QR code | No | ffffff (white) | |
| qr-margin | The number of QR blocks to leave empty around the QR code | No | 4 | |
| error-correction-level | The QR [error correction level](https://en.wikipedia.org/wiki/QR_code#Error_correction) | No | M | |
| width | Width of the QR code image | No | 200 | |
| host | The host of the QR image server | No | quickchart.io | |
| protocol | The protocol of the QR image server | No | https | |

## Hosting

By default, this component uses the public [QuickChart](https://quickchart.io) web service to render QR codes, but you can use the `host` attribute to point to your own QR renderer.