Skip to main content
Communication data types let you encode a ready-to-send interaction into a QR code. When a user scans one of these codes, their device opens the appropriate app with the address, subject, or message already populated — removing friction from every touchpoint where you want someone to reach you.
Use E.164 format for all phone numbers (e.g. +12025550170). This international standard is unambiguous across carriers and countries, and is the safest format for SMS, WhatsApp, and phone QR payloads.

Email

QrCode::Email() generates a mailto: URI. When scanned, the device opens the default mail client with the recipient address, subject, body, CC, and BCC fields already populated.
The $address, $cc, and $bcc values are validated as proper email addresses. Passing an invalid address throws an InvalidEmailArgumentException.

Example


PhoneNumber

QrCode::PhoneNumber() generates a tel: URI that opens the device dialler with the number pre-filled.

Example

Although the constructor accepts integers for convenience (e.g. when pulling from a numeric database column), always prefer a string prefixed with + and the country code to ensure the dialler opens correctly on every device.

SMS

QrCode::SMS() generates an sms: URI. Scanning it opens the device’s messaging app with the recipient number and an optional pre-filled message body.

Example


WhatsApp

QrCode::WhatsApp() generates a https://wa.me/ deep-link. Scanning it opens WhatsApp with a pre-selected conversation and an optional pre-filled message. You can call it with either an array or positional arguments:
The + prefix is stripped automatically from the number before building the wa.me URL, as the WhatsApp API requires a bare numeric international number.

Example

Passing an empty string as the phone number throws an InvalidWhatsAppArgumentException. Validate and sanitise the number before passing user input.

Telegram

QrCode::Telegram() generates a https://t.me/ link pointing to a public Telegram profile or channel. Scanning it opens the Telegram app directly on the profile page.
The username must match the Telegram rule: starts with a letter, 5–32 characters, alphanumeric and underscores only. Leading @ symbols are stripped automatically, so both myChannel and @myChannel are accepted. Invalid usernames throw an InvalidTelegramArgumentException.

Example

This data type links to a public Telegram username. Private users or channels without a public username cannot be encoded this way.