Integrating Google reCAPTCHA into your existing HTML subscription form

If you currently use an HTML subscription form that calls the Subscription Servlet Version 1, make the following additions or changes in the HTML code of your existing subscription form in order to be able to use Google reCAPTCHA.

1. Integrate the Subscription Servlet Version 2.

Copy
https://web.inxmail.com/[organisation]/subscription/servletv2"

2. At the end of the first line of the <form> tag, enter id="displayform".

Copy
<form ACTION="https://web.inxmail.com/[organisation]/subscription/servletv2" METHOD="post" id="displayform">

3. Insert the following script within the <head> tag.

Copy
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<script>
    function onSubmit(token) {
    document.getElementById("displayform").submit();
    }
</script>

4. Enter the site key for Google reCAPTCHA.

The site key is as follows: 6Ld673sUAAAAANIr4kvsqp3F1i4iiOatKNVWVCL2 (Note: The site key is the same for all ASP customers.)

Copy
<button class="g-recaptcha" data-sitekey="6Ld673sUAAAAANIr4kvsqp3F1i4iiOatKNVWVCL2" data-callback='onSubmit'>Subscribe</button>

Perform the steps described below in Inxmail Professional.

5. Enter the following domains in Inxmail Professional:

  • Server domain(s) on which you are hosting the HTML subscription form.

  • Server domain(s) to be redirected to following successful subscription.

    The server domain(s) to be redirected to following successful subscription is/are connected with the INXMAIL_HTTP_REDIRECT parameter. The value that the parameter expects is the URL to be redirected to after the subscription process has been successfully initiated.

    Example After the (future) recipient has clicked the Subscribe button, they are redirected to the following URL:

    https://www.example.com/subscribed

    In this case, you need to enter the (main) domain example.com.

Step by step

Proceed as follows to enter the domains in Inxmail Professional that you need to store in your HTML subscription form to ensure that Google reCAPTCHA functions:

  1. Click the (Global settings) tab.
  2. Click the Properties agent.
  3. Select the advanced property Configure Google reCAPTCHA (HTML subscription form).

    The button is displayed at the end of the line.

  4. Click thebutton.

    A dialog box appears.

  5. Click Add domain.

    A dialog box appears.

  6. Enter the main domain.
  7. Confirm the dialog box by clicking OK.

    You return to the Configure Google reCAPTCHA dialog box.

  8. Confirm the dialog box by clicking OK.
  9. Save your entries.
  • You have entered the domains in Inxmail Professional that you need to store in your HTML subscription form to ensure that Google reCAPTCHA functions.