//Developer assistance is required.


What’s a hashed email?


Hashed email address is a method of encrypting an email address. Using hashed emails helps protect the contact’s PII data without compromising privacy. It encodes email addresses using a cryptographic hashing function. It can be used to match the same email used by two different parties. Each can then hash the email address and arrive at the same hashed value. This way email addresses can be securely exchanged without sharing them in their clear text form. 


How to encrypt and decrypt the email hash value?


Hashed email can be encrypted and decrypted using the secret email hash key provided in the Settings > Account info section. We use the AES-128 encryption method to encrypt and decrypt the email hash.  



How to include an encrypted email hash in the embed code?


Firstly, Add a web-app embed collector and activate it. Copy the embed code. To include the encrypted email hash, you will have to add a contact attribute ‘work_email_hash’ in the contact object of the embed code. You can pass this dynamic hashed email values generated using the secret email hash key provided in the Settings > Account info section. We will detect this attribute used in the request and decrypt the contact email. 


You can enable email hashing encryption by passing the 'work_email_hash' variable as shown below:

<script src="https://cdn.surveyserv.com/widget.min.js"></script>
  <script>
  SurveyWidget.init({
        type: "default",
        delay: 5,
        include_unsubscribe :true,
        survey_id: "f3e0eef9-d4ab-47f9-8a28-91ee3d76d781",
        survey_collector_id: "SC-394",contact: {
        "first_name": "John",  // Replace with your contact's first name 
        "last_name": "Doe",    // Replace with your contact's last name
        "work_email_hash": "{{your dynamic value goes here}}",  // Replace with contact's work email hash 
      }
  })
  </script>