Double Opt-In

Double opt-in procedure

Note: These features are part of the Visforms Subscription and are not included in the free Visforms version.

Overview

Why use a double opt-in procedure?

For data protection reasons, a so-called double opt-in procedure may be necessary. This is particularly the case if the data is to be used for repeated advertising purposes. A repeated advertising purpose is a newsletter as an example.

What is a double opt-in procedure?

A double opt-in procedure means the following. After the user has filled out and sent the form, he must confirm in a separate second step that he actually agrees to the data use described. The user’s explicit consent to the use of data expresses, for example, that he actually wants to receive the newsletter at the email address provided.

For this purpose, the user receives an email with a confirmation link. Only if he clicks on this confirmation link can the final registration for the selected data usage take place.

The classic procedure and external target systems

In a classic double opt-in procedure, the user data is usually transferred to an external target system after successful confirmation. An external target system is, for example, special newsletter software. As a rule, these external target systems offer a defined data interface to transfer the login data. However, in the system of the original data entry, the registration data will be deleted.

What Visforms does

In your case, the original data entry takes place in the Visforms forms. This fundamental process is also the basis for the development of a double opt-in procedure with Visforms. Visforms itself is not a proven newsletter component, but offers a general registration process in a legally correct form.

Functionality

Here is a short list of the steps of the double opt-in process with Visforms:

  • The data submitted by the user with the form is temporarily stored in a Visforms data table.
    The data receive the status “unconfirmed”.
  • The user receives an email with his confirmation link.
  • You configure the email with the confirmation link yourself.
  • A PDF file of this confirmation email is stored on the server as later proof of the transferred data.
  • The user can react differently
    • The user does not confirm or does not confirm in time (see below)
    • The user confirms in time (see below)
    • User confirms multiple times (see below)

The user does not confirm or not in time

If the confirmation link in the double opt-in mail is not clicked within a period of time specified by you, the saved data including the PDF file will be deleted again. If the link is accessed too late, the user will receive an appropriate error message.

The user confirms in time

If the link is successfully confirmed within a set period of time, the status of the record is changed to “confirmed”. With this changed status, the data becomes visible in Visforms.

The confirmation is also logged-in a form-specific log file. The log file for the double opt-in procedure is located in the visforms_datalogs subdirectory.

This subdirectory is created directly under the Joomla log directory. You define the Joomla log directory in the Joomla configuration of your website. Default for the Joomla log directory is administrator/logs.

The following data is logged:

  • time of transmission,
  • Action (dates confirmed),
  • Form ID,
  • Record ID and
  • Confirmation URL.

Visforms triggers a custom event that can be used to write the custom code. This will be necessary in order to transfer the user data to the target system in which they are later to be permanently stored and used.

The user will be automatically redirected to the success page you specified.

The user confirms multiple times

If the user calls up the link in time and thereby confirms this, this one-time link will become invalid. If the link is accessed again, the user will receive a corresponding error message.

configuration

The procedure is configured in three places:

  • Activate the following plugins:
    • Plugin System - Clear Visforms data.
    • Plugin Visforms - Double-Opt-In.
  • In the form configuration on the “Result” tab:
    • Set the option “Save result” to “yes”.
  • In the form configuration on the “Mail Options” tab:
    • Configure the “email to the user” that is sent as a double opt-in mail.
    • Follow the instructions “The Double-Opt-In Mail” below.
  • In the form configuration on the “Double-Opt-In” tab
    • Set the “Enable” option to “yes”.
    • Specify how many days the confirmation link in the double opt-in mail should be valid.
      1 day is a good value here.
    • If necessary, assign a text for the confirmation link in the double opt-in mail in the “Text” option.
    • Provide a complete absolute URL in the “Redirect URL” option.
      The user is redirected to this URL after he has clicked on the confirmation link in the double opt-in mail and the confirmation was successful.

Form configuration tab “Double-Opt-In”

Double Opt in Options

The double opt-in mail

Note: Visforms uses the "email to the user" as a double opt-in mail. In order for the double opt-in process to run correctly, the "email to the user" must be activated and set up correctly.

Follow the steps and points below to configure the “email to the user” as a double opt-in mail:

  • Go to the “Mail Options” tab in the form configuration.
  • Activate the sending of the “email to the user”.
  • Enter a suitable legally compliant text for a double opt-in mail under “User email text”.
  • Use the placeholder ${*doiclink*} in the email text to insert the confirmation link into the email.
    This placeholder will be automatically replaced with the correct confirmation link.
  • If you have stored a link text in the double opt-in configuration, this will be used.
  • Make sure that you transfer all data that the user has entered with the double opt-in mail.
    The easiest way to do this is to set the options “Send data”, “Exclude empty fields” and “Insert creation time” to “yes”.
    All other data transfer options are set to “no”.

Processing of the data after successful confirmation

In a classic double opt-in procedure, the user data is usually transferred to an external target system after successful confirmation. An external target system is, for example, special newsletter software.

As a rule, these external target systems offer a defined data interface to transfer the login data. However, whether such an interface exists and what it looks like depends on the selected target system. It is therefore an individual development.

Visforms offers an interface through which individual code can be triggered. In this case, the code is triggered after a double-opt record has been successfully confirmed.

To do this, Visforms uses the event onVisformsAfterConfirmDoi. This and other events can be used in a custom Visforms plugin to run your custom code. See further below: Development of a data interface to the target system.

If such individual code does not exist, then the data sets remain stored in Visforms. The data sets are visible in the Visforms data table after successful confirmation.

Note: If you have activated the "Double-Opt-In" option for a form, all existing records for which there is no confirmation and whose confirmation period has expired are always automatically deleted.

Caution: Be very careful if you subsequently activate the double opt-in procedure for an existing form for which data has already been saved. In this case you will lose the already saved data.

Development of a data interface to the target system

After a record has been successfully confirmed, Visforms triggers the onVisformsAfterConfirmDoi event with the following function signature:

public function onVisformsAfterConfirmDoi ($context, $fid, $recordId) {
// Get the user data from the visforms data table using the recordId (recordId = id)
// recordId corresponds to the value in the database field id
// Use the recordId to get the double opt-in data from the #__visdoubleoptindata table
// recordId corresponds to the value in the database field doi_id
// Pass user data to the external system
// If necessary, transfer the pdf of the confirmation email to an external system
// The PDF file is located in the administrator\components\com_visforms\pdfs\doi directory
// The filename is stored in the double-opt-in data in the "mailpdf" field
// Clear user data in visforms data table
// Delete double opt-in record in table #__visdoubleoptindata
// Delete the PDF of the confirmation email
}