How to Prefill a Signup Form With User Information

Pass values into a SmashSend form through the URL so people do not retype what you already know. Includes the encoding rules and reserved parameters.

Last updated September 3, 2023

Availability: field prefilling is rolling out. The URL format below is the one it will use, so links you build now keep working once it is live.

If you already know who someone is, you should not make them type it again. You can pass values into a SmashSend form through the URL, and the matching fields are filled in before the person sees the form.

The URL format

Add a query parameter for each field you want to fill. The parameter name is the field key, which you can find next to each field in the form builder.

https://smashsend.com/f/YOUR_FORM_KEY?email=jane@acme.com&name=Jane

Anything you do not pass is simply left blank. The person can still edit a prefilled field before submitting.

Encode your values

Query strings cannot contain raw spaces, ampersands or plus signs, so URL-encode every value you interpolate. In JavaScript:

const url = new URL("https://smashsend.com/f/YOUR_FORM_KEY");

url.searchParams.set("email", user.email);
url.searchParams.set("name", user.fullName);

// searchParams.set encodes for you, so spaces and symbols are safe.
window.location.href = url.toString();

Prefill from an email

Inside a SmashSend email you can build the link with contact properties, so each recipient gets their own prefilled form:

<a href="https://smashsend.com/f/YOUR_FORM_KEY?email={{contact.email}}">
  Complete your details
</a>

Reserved parameters

Two parameter names are reserved and are not treated as fields:

  • ref tracks who referred this signup. It is set automatically on the share links your referrers get, so do not overwrite it.
  • password unlocks a password-protected form.

If one of your own fields uses a reserved key, rename the field key in the builder to avoid the clash.

A word on trust

Anything in a URL can be edited by the person opening it, so treat prefilled values as a convenience rather than as verified data. If you need to be certain who submitted a form, confirm it on your side, or turn on double opt-in so the email address has to be verified.

Have questions?

If you get stuck, email support@smashsend.com or contact us.

Keep reading

Other products from us:TidySupport·SuperBuilder·Inbounter·Blossu·KnowledgeSDK·TypeHop·EverydaySEO
text us!
SmashSend
SmashSendiMessage
􀍉
iMessage · Today 9:41 AM
hey, text us 👋
let's build something cool 🚀
Delivered
Text Message􀰓