Prefil email field using url parameter | Community
Skip to main content
September 21, 2015
Solved

Prefil email field using url parameter

  • September 21, 2015
  • 3 replies
  • 8294 views

We have a scenario where customers will phone or email our Contact Centre directly and ask to be unsubscribed. Our CC staff do not have access to Marketo and we do not have a CRM to manage this.  They have asked that:

  1. When a customer contacts us directly, our CC staff will provide that customer with a URL
  2. The URL will be a Marketo (unsubscribe) landing page, with the email address prefilled.
  3. The customer will then go to that landing page, with their email address prefilled, and confirm they wish to be unsubscribed by clicking on the unsubscribe button.

My question is, without access to Marketo, is there a way for our CC staff to generate a URL of the unsubscribe landing page, that allows email address prefil?  Something that would simply require them to just update the email address in the URL each time?

TIA

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Sure. An easy approach is by having a regular Rich Text widget in addition to the hidden text field.  Copy the value into the widget so you can style it however you want.

Just takes a little line of JS:

MktoForms2.whenReady(function(form){

  form.getFormElem()[0].querySelector('#showEmail').innerHTML = form.getValues().Email;

})

Demo here: http://pages.vaneck.com/simple-unsubscribe.html?Email=chantell@tapsell.com

3 replies

SanfordWhiteman
Level 10
September 21, 2015

Sure, it's very easy. In Form Editor, set the Email field to pull its value from the URL param "email." To set this up, use the Hidden field type. Then you could unhide it using JS if you want, or just read the value out and put it somewhere else on the page (form.getValues().Email).

September 22, 2015

Thanks Sanford.  I can easily set the Form Editor to pull the URL param for it's value.  But ideally i still want that field to be visible for the customer, as we want the customer to view their email address and confirm that is the one they wish to unsubscribe.

is there a way for the field to still be visible and also accept URL param?

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
September 22, 2015

Sure. An easy approach is by having a regular Rich Text widget in addition to the hidden text field.  Copy the value into the widget so you can style it however you want.

Just takes a little line of JS:

MktoForms2.whenReady(function(form){

  form.getFormElem()[0].querySelector('#showEmail').innerHTML = form.getValues().Email;

})

Demo here: http://pages.vaneck.com/simple-unsubscribe.html?Email=chantell@tapsell.com

Neil_Robertson6
Level 4
September 21, 2015

That is the way to do it but I would, if possible, see if you can encrypt/decrypt the string and not pass emails in the URL as plain text - otherwise your database could be open for rogue unsubscribes.

SanfordWhiteman
Level 10
September 21, 2015

Unless you mean leaving it encrypted all the way to the back end (necessitating a custom, very complex back-end workflow that I don't know that anybody is actually doing in reality) then you can already post the form on behalf of whomever you choose.

Adobe Employee
September 21, 2015

It's also possible that your CC staff could unsubscribe leads themselves.  You'd just want to be sure that munchkin was removed from the page so their browsers didn't get cookied as the lead's themselves.  You can find instructions for that below.

How to remove Munchkin from landing pages

John

SanfordWhiteman
Level 10
September 21, 2015

You need to remove the _mkto_trk cookie / _mkt_trk field from the form as well, not just remove Munchkin (because staff will already have a Munchin cookie).