Case 3 : Bind the consent to the mail adress given in the form

1. Video presentation

2. Concrete Example

You have a contact form that collects personal datas such as name, first name, mail, and you want this form to be in accordance with the reglementation and to fill your consents register.

For this, you want to add a checkbox and bind your consents register to the mail adress of the client, while keeping your graphic style

For this, you'll have to bind your Axeptio register to your checkbox with the previous method :

Then, just add the CSS selector corresponding to the mail field that you want to use as token. Which will give this code

 window._axcb.push(function(axeptio) {
  var host = document.getElementById('consentCheckbox');
   
     axeptio.createConsentCheckbox({
//Name of the service is "processings" for marketing consents or "contracts" for contracts consents 
     service: 'processings',
//identifier is the identifier of the checkbox you want to target : marketing consents or contract consents 
//We'll see later where to find it
     identifier: 'Otken_du_service',
     node: document.getElementById('TODO changer par l'ID du div cible'),
     
     embed: {
// Where you will provide all infos and text on the purpose of your form
       checkboxText: "J'accepte de recevoir la newsletter",
       checkboxDetailsText: "en savoir plus"
       
// With this method you can replace the anonymized token with a field from your form
    	tokenMethod: 'value',
// Enter here the CSS selector of the desired field 
// Usually the mail field
   	 token: '................'

  }
});
//
  host.querySelector('input[type=checkbox]').setAttribute('required', 'required');
});

😍 Congrats ! 😍

Last updated