Pre-filling of contact forms
This tutorial shows how to prefill a form on your webside with user data based on an UM entry.
First install and setup an um project with the Contact Form app if not done jet.
Following create a new Contact Form app instance and continue with the next step.
Create a mailing template
Go To Tools / Mailing Templates and create a new email template prefillContactFormByMsgid
according to your needs.
However, be sure to include a link pointing to the contact form page:
Plain text: <[FormularURL]?msgid={msgid}>
HTML: <a href="[FormularURL]?msgid={msgid}">Click here</a>
Enable prefill form option
Go to Tools / Apps / Contact Form , open the app instance and navigate to the contact form tab.
Change the email notification to the newly created mailing template.
Then go down to the Pre-filling of contact forms option and select the check box Fill out the contact form with user data.
For the first test of this tutorial leave the behavior when wrong msgid option as it is.
Send a contact request
Go to your browser, call your website and navigate to your contact form.
Your page should look like this:
Fill out the form and submit it by clicking the Send button.
Go back to the Universal Messanger and navigate to Tools/Mail-Log. You should see an email to your choosen emil address. Open the link from this email.
Your webside should load with pre-filled contact form fields.
Send contact request with wrong msgid
Now manipulate the URL bei adding an A at the end of the msgid and press enter. Your contact form should now be loaded with empty fields because of the settings and the wrong msgid.
Next go back to the Universial Messenger and navigate to your Contact From app instance (Tools/ Apps/ Contact Form). Change the behavior when wrong msgid option to Show error message.
Now go back to your Webpage and call the url with manipulated msgid. Instead of the form you should the the error message set up in your app instance.