mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 09:35:39 -05:00
🐛Email new contacts on old EU lead from correct email
This commit is contained in:
parent
db4cc18dcd
commit
3d7b055bee
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue