Socket
Book a DemoInstallSign in
Socket

mjml-qr-code

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mjml-qr-code

Embed QR codes in your emails

latest
Source
npmnpm
Version
2.0.1
Version published
Weekly downloads
318
360.87%
Maintainers
1
Weekly downloads
 
Created
Source

mjml-qr-code

npm Build Status

A component for adding QR codes to your email using an open-source QuickChart provider.

Usage

This mjml...

<mjml>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-qr-code value="hello world" />
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>

Will show this QR code:

QR code

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 <mj-qr-code> tag supports all the attributes of the <mj-image> tag. View those attributes here.

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

NameDescriptionRequired?Default
valueThe content encoded in your QR codeYes
colorThe color of the QR codeNo000000 (black)
background-colorThe background of the QR codeNoffffff (white)
qr-marginThe number of QR blocks to leave empty around the QR codeNo4
error-correction-levelThe QR error correction levelNoM
widthWidth of the QR code imageNo200
hostThe host of the QR image serverNoquickchart.io
protocolThe protocol of the QR image serverNohttps

Hosting

By default, this component uses the public QuickChart web service to render QR codes, but you can use the host attribute to point to your own QR renderer.

FAQs

Package last updated on 15 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts