A verification email is on its way to you. Please check your spam or junk folder just in case.
Issues with signing in? Click here
Need help signing in?
Don't have an account? Register now
Get limited access to our industry news, analysis and data, plus regular email updates
To register, please review and accept our terms and conditions and privacy notice.
Your email address is already registered with us. Click here to receive a verification link and login.'; reg_email_validation_message.querySelector('#resend-login-link').addEventListener('click', resendLoginLink); } }); } const resendLoginLink = function (e) { const identifier = reg_email.value, payloadData = JSON.stringify({ identifiers: { email_address: identifier, }, delivery: { method: 'email', destination: identifier, action: 'login', redirect: window.location.href.replace(window.location.origin, ''), }, }); blaizeRequest('/blaize/token-exchange', payloadData, function (status, response) { if (status === 201) { if (response.message) { reg_email_validation_message.innerHTML = response.message; } } else if (status === 401) { reg_email_validation_message.innerHTML = 'The email address you entered is incorrect.'; } else if (status === 404) { reg_email_validation_message.innerHTML = 'User not found.'; } else if (status === 429) { reg_email_validation_message.innerHTML = 'To gain login access, please contact your administrator.'; } else { reg_email_validation_message.innerHTML = 'Something went wrong! Please try again later.'; } }); } reg_email.addEventListener('input', removeIncorrectChars); reg_email.addEventListener('change', removeIncorrectChars); reg_email.addEventListener('change', checkEmailExists); login_email.addEventListener('input', removeIncorrectChars); login_email.addEventListener('change', removeIncorrectChars); } function handleUSstate() { const country = document.getElementById('country'), USstate = document.getElementById('USstate'), labelUSstate = document.querySelector('label[for="USstate"]'); country.addEventListener('change', function (e) { const val = e.target.value; if (val === US_COUNTRY_CODE) { labelUSstate.style.display = 'block'; USstate.disabled = false; USstate.setAttribute('required', 'required'); } else { labelUSstate.style.display = 'none'; USstate.value = ''; USstate.disabled = true; USstate.removeAttribute('required'); } }); } function handleSuccessfulRegistration() { const addParselyTrackPageView = function () { const el = document.createElement('script'); el.src = 'https://cdn.parsely.com/keys/' + PARSELY_URLS[BRAND] + '/p.js'; el.onload = function () { PARSELY.beacon.trackPageView({ url: window.location.href, urlref: window.location.href, action: 'NewUserRegistration', }); }; document.body.appendChild(el); }; const addGAEvent = function () { window.dataLayer = window.dataLayer || []; dataLayer.push({ event: 'visitor interaction', interaction_name: 'registration', }); }; window.Blaize.registerFormPostProcessor('registration-form', function (formData, response) { if (response.message === BLAIZE_SUCCESS_RESPONSE && response.tracking_id) { addParselyTrackPageView(); addGAEvent(); } else { console.log('Registration error: ', response.message); } }); } function handleForms() { const section = document.getElementById('zephr-registration-form'), formRegister = section.querySelector('.blaize-form-register'), formLogin = section.querySelector('.blaize-form-login'), registerError = formRegister.querySelector('.blaize-error'), registerSuccess = formRegister.querySelector('.blaize-success'), loginError = formLogin.querySelector('.blaize-error'), loginSuccess = formLogin.querySelector('.blaize-success'); const processMessage = function (message) { return message .replace(' ', ' ') .replace(/<[^>]+>/gi, '') // strip tags .trim(); }; const addTrailingDot = function (message) { if (!/\.$/.test(message)) { message += '.'; } return message; }; const getUserAttributes = function () { const attributes = {}, inputs = formRegister .querySelector('.blaize-user-attributes') .querySelectorAll('input[name], textarea[name], select[name]'); let input; for (let i = 0; i < inputs.length; i++) { input = inputs[i]; if (!input.name) { continue; } if ('checkbox' === input.type) { attributes[input.name] = input.checked; } else { attributes[input.name] = input.value; } } return attributes; }; const showRegisterSuccess = function (message) { if (message === false) { registerSuccess.style.display = 'none'; return; } registerSuccess.innerHTML = message; registerSuccess.style.display = 'block'; }; const showRegisterError = function (message) { if (message === false) { registerError.style.display = 'none'; return; } registerError.innerHTML = message; registerError.style.display = 'block'; }; const showRegisterLoader = function () { const button = formRegister.querySelector('button[type="submit"]'); button.querySelector('.button-text').style.display = 'none'; button.querySelector('.button-loader').style.display = 'block'; button.disabled = true; }; const hideRegisterLoader = function () { const button = formRegister.querySelector('button[type="submit"]'); button.querySelector('.button-text').style.display = 'block'; button.querySelector('.button-loader').style.display = 'none'; button.disabled = false; }; const hideRegisterFormPartsWhenDone = function () { formRegister.querySelector('.blaize-user-attributes').style.display = 'none'; formRegister.querySelector('.blaize-validators').style.display = 'none'; formRegister.querySelector('.blaize-to-login').style.display = 'none'; }; const showLoginSuccess = function (message) { if (message === false) { loginSuccess.style.display = 'none'; return; } loginSuccess.innerHTML = message; loginSuccess.style.display = 'block'; }; const showLoginError = function (message) { if (message === false) { loginError.style.display = 'none'; return; } loginError.innerHTML = message; loginError.style.display = 'block'; }; const showLoginLoader = function () { const button = formLogin.querySelector('button[type="submit"]'); button.querySelector('.button-text').style.display = 'none'; button.querySelector('.button-loader').style.display = 'block'; button.disabled = true; }; const hideLoginFormPartsWhenDone = function () { formLogin.querySelector('.blaize-login-passwordless').style.display = 'none'; formLogin.querySelector('.blaize-validators').style.display = 'none'; formLogin.querySelector('.blaize-to-register').style.display = 'none'; }; const triggerRegisterPreSubmitEvent = function (attributes) { const event = new CustomEvent('registration-form-pre-submit', {detail: attributes}); document.body.dispatchEvent(event); }; const triggerRegisterDoneEvent = function (identifier) { const event = new CustomEvent('registration-form-done', {detail: identifier}); document.body.dispatchEvent(event); }; const triggerLoginDoneEvent = function (identifier) { const event = new CustomEvent('login-form-done', {detail: identifier}); document.body.dispatchEvent(event); }; const handleRegister = function (e) { e.preventDefault(); const identifier = formRegister.querySelector('input[name="email_address"]').value, attributes = getUserAttributes(); triggerRegisterPreSubmitEvent(attributes); const registerData = window.Blaize.preProcessFormData( formRegister.getAttribute('data-blaize-form'), { identifiers: { email_address: identifier, }, validators: {}, attributes: attributes, } ); showRegisterSuccess(false); showRegisterError(false); // Handle error message from preprocessors if (typeof registerData === 'string') { showRegisterError(registerData); return; } showRegisterLoader(); blaizeRequest( '/blaize/register', JSON.stringify(registerData), function (status, response) { window.Blaize.postProcessFormData( formRegister.getAttribute('data-blaize-form'), registerData, response ); if (status === 200) { const registerMessage = response.message || '', passwordlessData = { identifiers: { email_address: identifier, }, delivery: { method: 'email', destination: identifier, action: 'register', redirect: window.location.href.replace(window.location.origin, ''), }, }; blaizeRequest( '/blaize/token-exchange', JSON.stringify(passwordlessData), function (status, response) { if (status === 201) { if (response.message) { hideRegisterFormPartsWhenDone(); showRegisterSuccess( addTrailingDot(registerMessage) + '' + processMessage(response.message) ); triggerRegisterDoneEvent(identifier); } } else { showRegisterError('Something went wrong! Please try again later.'); } } ); } else if (status === 409) { showRegisterError( 'Your email is already registered with us. To access this site simply sign in using the link below.' ); hideRegisterLoader() } else if (status === 400 || status === 402) { showRegisterError(processMessage(response.message)); hideRegisterLoader() } else { showRegisterError('Something went wrong! Please try again later.'); hideRegisterLoader() } } ); }; const handleLogin = function (e) { e.preventDefault(); const identifier = formLogin.querySelector('input[name="email_address"]').value, payloadData = JSON.stringify({ identifiers: { email_address: identifier, }, delivery: { method: 'email', destination: identifier, action: 'login', redirect: window.location.href.replace(window.location.origin, ''), }, }); showLoginSuccess(false); showLoginError(false); showLoginLoader(); blaizeRequest('/blaize/token-exchange', payloadData, function (status, response) { if (status === 200) { if (response.cookie) { document.cookie = response.cookie; window.location.reload(true); } } else if (status === 201) { if (response.message) { hideLoginFormPartsWhenDone(); showLoginSuccess(processMessage(response.message)); triggerLoginDoneEvent(identifier); } } else if (status === 401) { showLoginError('The email address you entered is incorrect.'); } else if (status === 404) { showLoginError('User not found.'); } else if (status === 429) { showLoginError('To gain login access, please contact your administrator.'); } else { showLoginError('Something went wrong! Please try again later.'); } }); }; const switchForms = function () { section.querySelector('.blaize-to-login a').onclick = function (e) { e.preventDefault(); formRegister.style.display = 'none'; formLogin.style.display = 'block'; }; section.querySelector('.blaize-to-register a').onclick = function (e) { e.preventDefault(); formLogin.style.display = 'none'; formRegister.style.display = 'block'; }; }; const handleFormsSubmit = function () { formRegister.addEventListener('submit', handleRegister); formLogin.addEventListener('submit', handleLogin); }; switchForms(); handleFormsSubmit(); } document.addEventListener('DOMContentLoaded', function () { createBlaizeObject(); setSourceRegistration(); handleForms(); handleEmail(); handleUSstate(); handleSuccessfulRegistration(); }); })();
Email address not recognised.
Don't have an account? Click here to register
Nearly there!
Copyright PEI Media
Not for publication, email or dissemination