@@ -293,9 +293,13 @@ function prepareOrderJSON(order) {
293293 var customerEmail = null ;
294294
295295 if ( ! empty ( customerProfile ) ) {
296- customerEmail = empty ( customerProfile . email ) ? null : YotpoUtils . escape ( customerProfile . email , Constants . REGEX_FOR_YOTPO_DATA , '' ) ;
296+ // Removing the escape for now as this regex removes special chars. Potentially in the future we could implement a more accurate regex
297+ //customerEmail = empty(customerProfile.email) ? null : YotpoUtils.escape(customerProfile.email, Constants.REGEX_FOR_YOTPO_DATA, '');
298+ customerEmail = empty ( customerProfile . email ) ? null : customerProfile . email ;
297299 } else {
298- customerEmail = empty ( order . customerEmail ) ? null : YotpoUtils . escape ( order . customerEmail , Constants . REGEX_FOR_YOTPO_DATA , '' ) ;
300+ // Removing the escape for now as this regex removes special chars. Potentially in the future we could implement a more accurate regex
301+ // customerEmail = empty(order.customerEmail) ? null : YotpoUtils.escape(order.customerEmail, Constants.REGEX_FOR_YOTPO_DATA, '');
302+ customerEmail = empty ( order . customerEmail ) ? null : order . customerEmail ;
299303 }
300304
301305 if ( ! order . orderNo || ! customerEmail || ! order . currencyCode || empty ( orderTotalPrice ) ) {
@@ -355,7 +359,9 @@ function prepareOrderJSON(order) {
355359 customerJSON . id = customerProfile . customerNo ;
356360 customerJSON . first_name = YotpoUtils . escape ( customerProfile . firstName , Constants . REGEX_FOR_YOTPO_DATA , '' ) ;
357361 customerJSON . last_name = YotpoUtils . escape ( customerProfile . lastName , Constants . REGEX_FOR_YOTPO_DATA , '' ) ;
358- customerJSON . email = YotpoUtils . escape ( customerProfile . email , Constants . REGEX_FOR_YOTPO_DATA , '' ) ;
362+ // Removing the escape for now as this regex removes special chars. Potentially in the future we could implement a more accurate regex
363+ // customerJSON.email = YotpoUtils.escape(customerProfile.email, Constants.REGEX_FOR_YOTPO_DATA, '');
364+ customerJSON . email = customerProfile . email ;
359365 }
360366
361367 var orderPriceAjustments = new Array ( ) ;
0 commit comments