Integration Guide · For DMVEz Tech Team

MRS Service Finder — Embed in DMVEz Customer Portal

Drop the Montana Registration Services finder inside the DMVEz portal so existing customers can buy additional registrations without leaving the portal.

Owner: Tim Kennedy (timk@dirtlegal.com) Status: Live in production Updated: 2026-05-12

The URL

Embed this URL in an iframe. The finder is already chrome-free (no header / no footer), transparent background, and configured to skip lead capture and pre-fill from URL parameters.

https://quiz.mtregistrationservices.com/find-mrs-embed
What this funnel does: Walks the customer through the Full Montana Registration flow (vehicle type → ownership → title status → MSRP → home state → add-ons → checkout). Locked to Full Reg only — no path picker, no email/phone capture step (you'll pass identity via URL params below).

1. URL parameters (all optional)

Pass whatever DMVEz already knows about the customer. The finder will pre-fill the relevant fields and tag the GHL contact for clean attribution.

ParamEffectExample
email Pre-fills the email field on the order step. tim@example.com
first_name Pre-fills first name. firstName also accepted. Tim
last_name Pre-fills last name. lastName also accepted. Kennedy
name Alternative: pre-fills both names from one field. Tim Kennedy
phone Pre-fills phone field. 4065551234
dmvez_customer_id Passes through to GHL as a contact tag for portal-to-purchase attribution. Use the DMVEz customer ID so finance can join the two. cust_42891
source Defaults to dmvez_portal if omitted. Override only if you split-test multiple portal entry points. dmvez_portal

2. Iframe snippet

Drop this anywhere in the DMVEz portal. Replace the USER_* placeholders with the values you have on the customer at render time.

<iframe
  id="mrs-finder"
  src="https://quiz.mtregistrationservices.com/find-mrs-embed?email=USER_EMAIL&first_name=USER_FIRST&last_name=USER_LAST&phone=USER_PHONE&dmvez_customer_id=USER_ID"
  style="width:100%; border:0; min-height:600px; display:block;"
  allow="payment *; clipboard-read; clipboard-write"
  referrerpolicy="origin"
  title="Add a Montana registration">
</iframe>
Important: URL-encode the user values when you build the src string. Phone numbers with + or names with spaces will break otherwise. In JS: encodeURIComponent(value).

3. PostMessage listener (required)

The iframe posts two events to the parent window. Wire this listener once on the portal page so the iframe grows with content and so checkout escapes the iframe cleanly.

<script>
window.addEventListener('message', function (e) {
  // Only trust messages from our finder origin.
  if (e.origin !== 'https://quiz.mtregistrationservices.com') return;
  var data = e.data || {};

  // (1) Auto-resize the iframe to fit content — fires on every step change.
  if (data.type === 'finder-resize' && typeof data.height === 'number') {
    var f = document.getElementById('mrs-finder');
    if (f) f.style.height = (data.height + 40) + 'px';
  }

  // (2) Customer finished the funnel — send the DMVEz portal top window to
  // DMVEz checkout. Don't nest a checkout iframe inside this iframe — Stripe
  // 3DS popups break in nested iframes.
  if (data.type === 'finder-navigate' && data.url) {
    window.location.href = data.url;
  }
});
</script>

4. End-to-end example (React)

If the DMVEz portal is React-based, this is the same thing wrapped as a component. customer is whatever shape your portal already has.

import { useEffect, useRef } from 'react';

const FINDER_ORIGIN = 'https://quiz.mtregistrationservices.com';

export function MrsFinderEmbed({ customer }) {
  const ref = useRef(null);

  useEffect(() => {
    function onMessage(e) {
      if (e.origin !== FINDER_ORIGIN) return;
      const data = e.data || {};
      if (data.type === 'finder-resize' && typeof data.height === 'number' && ref.current) {
        ref.current.style.height = (data.height + 40) + 'px';
      }
      if (data.type === 'finder-navigate' && data.url) {
        window.location.href = data.url;
      }
    }
    window.addEventListener('message', onMessage);
    return () => window.removeEventListener('message', onMessage);
  }, []);

  const params = new URLSearchParams({
    email:             customer.email      || '',
    first_name:        customer.firstName  || '',
    last_name:         customer.lastName   || '',
    phone:             customer.phone      || '',
    dmvez_customer_id: customer.id         || '',
  });

  return (
    <iframe
      ref={ref}
      src={`${FINDER_ORIGIN}/find-mrs-embed?${params.toString()}`}
      style={{ width: '100%', border: 0, minHeight: 600, display: 'block' }}
      allow="payment *; clipboard-read; clipboard-write"
      referrerPolicy="origin"
      title="Add a Montana registration"
    />
  );
}

5. What happens when the customer hits checkout

  1. Customer completes the finder steps inside the iframe.
  2. Finder creates a pending order via DMVEz API (server-side, no client work).
  3. Finder posts { type: 'finder-navigate', url: '<DMVEz checkout URL>' } to the parent (DMVEz portal).
  4. Your listener navigates the top window to that URL — the iframe and the portal page are replaced by DMVEz checkout.
  5. Stripe payment runs in full viewport (no nested iframes, 3DS popups work).
  6. After payment, DMVEz handles the post-checkout redirect per its own config.

6. Browser security notes

7. Verification checklist

Run these once in a DMVEz portal staging environment before going live.

Who to contact

Questions, bugs, or feature requests: timk@dirtlegal.com. Engineering side is owned by the TK-DL platform team.


Engineering reference: src/quiz-platform/widget/standalone-finder-mrs-embed.html · route src/quiz-platform/server.js#/find-mrs-embed · commit b096cf75