Magic Login now supports QR code login for WordPress. This feature allows users to log in by scanning a QR code — making the login process faster and more user-friendly. You can include QR codes in outgoing emails.
Using QR Code in Emails #
You can include a QR code in your login emails using the following placeholders:
{{MAGIC_LOGIN_QR}}
: Outputs the raw URL used in the QR code. You can use it manually inside an tag if needed.{{MAGIC_LOGIN_QR_IMG}}
: Outputs a full<img>
tag for the QR code.
These tags work just like {{MAGIC_LINK}}
, and can be used in:
- Magic Login email templates
- WooCommerce emails
- Any WordPress emails sent via
wp_mail()
Example (in email content):
Scan this QR code to log in:
{{MAGIC_LOGIN_QR_IMG}}
Or if you want to construct the manually:
<img src="{{MAGIC_LOGIN_QR}}" width="150" alt="Scan QR for Login">
Shortcode #
magic_login_qr shortcode allows you to display a static QR codes on any WordPress page or post. It is not directly tied to the login process but is useful for onboarding flows, offline actions, or marketing pages.
Parameters:
url
(required): The destination URL the QR code should encode.width
(optional): Width of the generated QR image in pixels (default: 150).
Example:
[magic_login_qr url="https://example.com/survey" width="150"]
This would display a 150x150px QR code linking to the specified survey page.
Image Format & Hosting Requirements #
- By default, QR codes are rendered in PNG format to ensure compatibility with email clients. (for email placeholders, shortcode will generate base64 encoded svg)
- PNG generation requires the GD extension to be installed and enabled on your server.