Skip to content

Commit a05dd1a

Browse files
Merge pull request #15 from YotpoLtd/release/21.5.5
Release/21.5.5
2 parents 3387ceb + 0f7a50c commit a05dd1a

File tree

6 files changed

+15
-7
lines changed

6 files changed

+15
-7
lines changed
92 Bytes
Binary file not shown.

cartridges/int_yotpo_sfra/cartridge/models/loyalty/common/loyaltyCustomerModel.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ function prepareCustomerJSON(profile) {
1313
var customerJSON;
1414

1515
try {
16-
var customerEmail = YotpoUtils.escape(profile.email, Constants.REGEX_FOR_YOTPO_DATA, '');
16+
// Removing the escape for now as this regex removes special chars. Potentially in the future we could implement a more accurate regex
17+
// var customerEmail = YotpoUtils.escape(profile.email, Constants.REGEX_FOR_YOTPO_DATA, '');
18+
var customerEmail = profile.email;
1719

1820
if (!customerEmail) {
1921
throw new Error(Constants.EXPORT_CUSTOMER_MISSING_MANDATORY_FIELDS_ERROR);

cartridges/int_yotpo_sfra/cartridge/models/loyalty/common/loyaltyOrderModel.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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();

cartridges/int_yotpo_sfra/cartridge/scripts/utils/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exports.YOTPO_CONFIGURATION_OBJECT = 'yotpoConfiguration';
2121
exports.YOTPO_JOBS_CONFIGURATION_OBJECT = 'yotpoJobsConfiguration';
2222
exports.DATE_FORMAT_FOR_YOTPO_DATA = 'yyyy-MM-dd';
2323
exports.PLATFORM_FOR_YOTPO_DATA = 'commerce_cloud';
24-
exports.YOTPO_CARTRIDGE_VERSION = '21.5.4';
24+
exports.YOTPO_CARTRIDGE_VERSION = '21.5.5';
2525
exports.REGEX_BASE_FOR_YOTPO_DATA = '^0-9a-zA-Z';
2626
exports.PRODUCT_REGEX_FOR_YOTPO_DATA = '[^0-9a-zA-Z\\_\\-]+';
2727
exports.REGEX_FOR_YOTPO_DATA = '[^0-9a-zA-Z\\s\\_\\-]+'; // allowing whitespace in this one

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "link_yotpo",
33
"packageName": "int_yotpo_sfra",
4-
"version": "21.5.4",
4+
"version": "21.5.5",
55
"description": "Yotpo ratings and reviews integration for SFCC Storefront Reference Architecture",
66
"author": "CQL Inc.",
77
"main": "index.js",

0 commit comments

Comments
 (0)