🐛Email new contacts on old EU lead from correct email

This commit is contained in:
Matt Lott 2016-09-20 05:55:18 -07:00
parent db4cc18dcd
commit 3d7b055bee

View file

@ -872,7 +872,7 @@ function updateCloseLeads(cocoContacts, done) {
const userApiKeyMap = {}; const userApiKeyMap = {};
let createGetUserFn = (apiKey) => { let createGetUserFn = (apiKey) => {
return (done) => { 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) => { request.get(url, (error, response, body) => {
if (error) return done(); if (error) return done();
const results = JSON.parse(body); const results = JSON.parse(body);
@ -885,6 +885,7 @@ function updateCloseLeads(cocoContacts, done) {
for (const closeIoMailApiKey of closeIoMailApiKeys) { for (const closeIoMailApiKey of closeIoMailApiKeys) {
tasks.push(createGetUserFn(closeIoMailApiKey.apiKey)); tasks.push(createGetUserFn(closeIoMailApiKey.apiKey));
} }
tasks.push(createGetUserFn(closeIoEuMailApiKey));
async.parallelLimit(tasks, closeParallelLimit, (err, results) => { async.parallelLimit(tasks, closeParallelLimit, (err, results) => {
if (err) console.log(err); if (err) console.log(err);
// Lookup existing leads via email to protect against direct lead name querying later // Lookup existing leads via email to protect against direct lead name querying later