mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Support alternate NL spelling in lead import automation
This commit is contained in:
parent
d9959db856
commit
33b614911c
1 changed files with 2 additions and 1 deletions
|
@ -107,6 +107,7 @@ function upsertLeads(done) {
|
|||
function getCountryCode(country, emails) {
|
||||
// console.log(`DEBUG: getCountryCode ${country} ${emails.length}`);
|
||||
if (country) {
|
||||
if (country.indexOf('Nederland') >= 0) return 'NL';
|
||||
let countryCode = countryList.getCode(country);
|
||||
if (countryCode) return countryCode;
|
||||
}
|
||||
|
@ -728,7 +729,7 @@ function createUpdateLeadFn(lead, existingLeads) {
|
|||
if (data.total_results === 0) {
|
||||
if (existingLeads[lead.name.toLowerCase()]) {
|
||||
if (existingLeads[lead.name.toLowerCase()].length === 1) {
|
||||
console.log(`DEBUG: Using lead from email lookup: ${lead.name}`);
|
||||
// console.log(`DEBUG: Using lead from email lookup: ${lead.name}`);
|
||||
return updateExistingLead(lead, existingLeads[lead.name.toLowerCase()][0], done);
|
||||
}
|
||||
console.error(`ERROR: ${existingLeads[lead.name.toLowerCase()].length} email leads found for ${lead.name}`);
|
||||
|
|
Loading…
Reference in a new issue