From 3d7b055bee5e377b275210374321e4d63088a0f4 Mon Sep 17 00:00:00 2001 From: Matt Lott Date: Tue, 20 Sep 2016 05:55:18 -0700 Subject: [PATCH] :bug:Email new contacts on old EU lead from correct email --- scripts/updateCloseIoLeads.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/updateCloseIoLeads.js b/scripts/updateCloseIoLeads.js index 49a384b1a..93bf44436 100644 --- a/scripts/updateCloseIoLeads.js +++ b/scripts/updateCloseIoLeads.js @@ -872,7 +872,7 @@ function updateCloseLeads(cocoContacts, done) { const userApiKeyMap = {}; let createGetUserFn = (apiKey) => { return (done) => { - const url = `https://${apiKey}:X@app.close.io/api/v1/me/`; + const url = `https://${apiKey}:X@app.close.io/api/v1/me/?_fields=id`; request.get(url, (error, response, body) => { if (error) return done(); const results = JSON.parse(body); @@ -885,6 +885,7 @@ function updateCloseLeads(cocoContacts, done) { for (const closeIoMailApiKey of closeIoMailApiKeys) { tasks.push(createGetUserFn(closeIoMailApiKey.apiKey)); } + tasks.push(createGetUserFn(closeIoEuMailApiKey)); async.parallelLimit(tasks, closeParallelLimit, (err, results) => { if (err) console.log(err); // Lookup existing leads via email to protect against direct lead name querying later