Login App and Newsletter registration forms

This tutorial explains how to enable a Newsletter registration form to be pre-filled from a pre-existing Login App user session.

As soon as the Login App is installed and your web pages are prepared for client-side usage of the Login App as described in Login App Setup client-side login form you can proceed to implement a Newsletter registration form.

Create Newsletter App instance

Go to Tools / Apps / Newsletter and create a new instance:

Enter an appropriate Title.

Select English as the Used language.

Remove the Category field from the Form wizard.

Add least one Default list, create a List if necessary.

Under Confirmation URL select Specify URL and enter the URL of the web page that will become your newsletter registration page.

 

Select Form initialization hook: Pre-fill from Login-App session

As usual, enter the publicly available URL of your REST Proxy.

Copy the Copy template to your clipboard and paste it into your new newsletter registration page.

Give it a try

Login to your website using the login form implemented in the previous tutorial step and navigate to the newsletter registration form.

The newsletter registration form should be pre-filled with you user’s firstname, lastname and email address.

Please note that this relies on a client-side mechanism that makes use of the global JavaScript variable window.pinuts.auth2 that is set by the file loaded via the <script> element implemented in Login App Setup client-side login form.

This mechanism for pre-filling Widget-based forms is not meant to be used to implement security-related logic!