From c7d3857d46452c61102fb12e041243d7eebf85b2 Mon Sep 17 00:00:00 2001 From: Matt Lott Date: Tue, 24 May 2016 16:54:38 -0700 Subject: [PATCH 1/2] Send all imported NL/BE leads to NL contact --- scripts/updateCloseIoLeads.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/updateCloseIoLeads.js b/scripts/updateCloseIoLeads.js index 68ddd783b..6d9cfc029 100644 --- a/scripts/updateCloseIoLeads.js +++ b/scripts/updateCloseIoLeads.js @@ -145,8 +145,11 @@ function getInitialLeadStatusViaCountry(country, trialRequests) { } const countryCode = countryList.getCode(country); if (countryCode) { + if (countryCode === 'NL' || countryCode === 'BE') { + return defaultEuLeadStatus; + } if (isEuCountryCode(countryCode)) { - return highValueLead ? 'Inbound EU Auto Attempt 1 High' : 'Inbound EU Auto Attempt 1'; + return highValueLead ? 'Inbound EU Auto Attempt 1 High' : defaultEuLeadStatus; } return defaultInternationalLeadStatus; } @@ -170,8 +173,11 @@ function getInitialLeadStatusViaEmails(emails, trialRequests) { if (!currentStatus || [defaultLeadStatus, defaultInternationalLeadStatus].indexOf(currentStatus) >= 0) { // Look for a better EU match const countryCode = getCountryCode(null, emails); + if (countryCode === 'NL' || countryCode === 'BE') { + return defaultEuLeadStatus; + } if (isEuCountryCode(countryCode)) { - return isHighValueLead(trialRequests) ? 'Inbound EU Auto Attempt 1 High' : 'Inbound EU Auto Attempt 1'; + return isHighValueLead(trialRequests) ? 'Inbound EU Auto Attempt 1 High' : defaultEuLeadStatus; } } currentStatus = currentStatus ? currentStatus : defaultLeadStatus; @@ -229,7 +235,7 @@ function isUSSchoolStatus(status) { } function getEmailApiKey(leadStatus) { - if (leadStatus === 'Inbound EU Auto Attempt 1') return closeIoEuMailApiKey; + if (leadStatus === defaultEuLeadStatus) return closeIoEuMailApiKey; if (closeIoMailApiKeys.length < 0) return; return closeIoMailApiKeys[Math.floor(Math.random() * closeIoMailApiKeys.length)]; } From 7c8a2b3020c87e45c5ad001d88bde149e888b066 Mon Sep 17 00:00:00 2001 From: phoenixeliot Date: Tue, 24 May 2016 16:59:36 -0700 Subject: [PATCH 2/2] Fix My Classes progress dot again --- app/lib/coursesHelper.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/coursesHelper.coffee b/app/lib/coursesHelper.coffee index ff3ed0594..0866d95e7 100644 --- a/app/lib/coursesHelper.coffee +++ b/app/lib/coursesHelper.coffee @@ -14,7 +14,7 @@ module.exports = instance.started = false levels = classroom.getLevels({courseID: course.id, withoutLadderLevels: true}) for userID in instance.get('members') - instance.started = _.any levels.models, (level) -> + instance.started ||= _.any levels.models, (level) -> return false if level.isLadder() session = _.find classroom.sessions.models, (session) -> session.get('creator') is userID and session.get('level').original is level.get('original')