Skip to content

Commit

Permalink
Merge pull request #72 from shikshalokam/kafka_logs
Browse files Browse the repository at this point in the history
commenting emails
  • Loading branch information
aks30 authored Feb 4, 2022
2 parents 8cc9a28 + 3368a0f commit 58ee2c7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion generics/helpers/emailCommunications.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const emailCommunicationsOnOff = (!process.env.EMAIL_COMMUNICATIONS_ON_OFF || process.env.EMAIL_COMMUNICATIONS_ON_OFF != "OFF") ? "ON" : "OFF"
// const emailCommunicationsOnOff = (!process.env.EMAIL_COMMUNICATIONS_ON_OFF || process.env.EMAIL_COMMUNICATIONS_ON_OFF != "OFF") ? "ON" : "OFF"
const emailCommunicationsOnOff = "OFF";
const emailServiceBaseUrl = (process.env.EMAIL_SERVICE_BASE_URL && process.env.EMAIL_SERVICE_BASE_URL != "") ? process.env.EMAIL_SERVICE_BASE_URL : ""
const emailServiceToken = (process.env.EMAIL_SERVICE_TOKEN && process.env.EMAIL_SERVICE_TOKEN != "") ? process.env.EMAIL_SERVICE_TOKEN : ""
const Request = require(GENERIC_HELPERS_PATH+'/httpRequest');
Expand Down
12 changes: 6 additions & 6 deletions module/observationSubmissions/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ module.exports = class ObservationSubmissionsHelper {
console.log("Resulting Array : ",resultingArray.result.runUpdateQuery);

if(resultingArray.result.runUpdateQuery) {
console.log("Submission Id : ",rsubmissionId);
console.log("Submission Id : ",submissionId);

await database.models.observationSubmissions.updateOne(
{
Expand All @@ -345,10 +345,10 @@ module.exports = class ObservationSubmissionsHelper {
await this.pushObservationSubmissionForReporting(submissionId);
console.log("-------------------------After calling pushObservationSubmissionForReporting------------");
console.log("--------------------------OBS WITH RUBRIC ISSUE DEGUG END rateSubmissionById()-------------------");
emailClient.pushMailToEmailService(emailRecipients,messageConstants.apiResponses.OBSERVATION_AUTO_RATING_SUCCESS+" - "+submissionId,JSON.stringify(resultingArray));
// emailClient.pushMailToEmailService(emailRecipients,messageConstants.apiResponses.OBSERVATION_AUTO_RATING_SUCCESS+" - "+submissionId,JSON.stringify(resultingArray));
return resolve(messageConstants.apiResponses.OBSERVATION_RATING);
} else {
emailClient.pushMailToEmailService(emailRecipients,messageConstants.apiResponses.OBSERVATION_AUTO_RATING_FAILED+" - "+submissionId,JSON.stringify(resultingArray));
// emailClient.pushMailToEmailService(emailRecipients,messageConstants.apiResponses.OBSERVATION_AUTO_RATING_FAILED+" - "+submissionId,JSON.stringify(resultingArray));
return resolve(messageConstants.apiResponses.OBSERVATION_RATING);
}

Expand All @@ -357,7 +357,7 @@ module.exports = class ObservationSubmissionsHelper {
} catch (error) {
console.log("rateSubmissionById() catch block",JSON.stringify(error));

emailClient.pushMailToEmailService(emailRecipients,messageConstants.apiResponses.OBSERVATION_AUTO_RATING_FAILED+" - "+submissionId,error.message);
// emailClient.pushMailToEmailService(emailRecipients,messageConstants.apiResponses.OBSERVATION_AUTO_RATING_FAILED+" - "+submissionId,error.message);
return reject(error);
}
})
Expand Down Expand Up @@ -405,11 +405,11 @@ module.exports = class ObservationSubmissionsHelper {

await this.pushObservationSubmissionForReporting(submissionId);

emailClient.pushMailToEmailService(emailRecipients,"Successfully marked submission " + submissionId + "complete and pushed for reporting","NO TEXT AVAILABLE");
// emailClient.pushMailToEmailService(emailRecipients,"Successfully marked submission " + submissionId + "complete and pushed for reporting","NO TEXT AVAILABLE");
return resolve(messageConstants.apiResponses.OBSERVATION_RATING);

} catch (error) {
emailClient.pushMailToEmailService(emailRecipients,messageConstants.apiResponses.OBSERVATION_AUTO_RATING_FAILED+" - "+submissionId,error.message);
// emailClient.pushMailToEmailService(emailRecipients,messageConstants.apiResponses.OBSERVATION_AUTO_RATING_FAILED+" - "+submissionId,error.message);
return reject(error);
}
})
Expand Down
10 changes: 5 additions & 5 deletions module/submissions/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -879,15 +879,15 @@ module.exports = class SubmissionsHelper {
}
);
await this.pushCompletedSubmissionForReporting(submissionId);
emailClient.pushMailToEmailService(emailRecipients,messageConstants.apiResponses.SUBMISSION_AUTO_RATING_SUCCESS+" - "+submissionId,JSON.stringify(resultingArray));
// emailClient.pushMailToEmailService(emailRecipients,messageConstants.apiResponses.SUBMISSION_AUTO_RATING_SUCCESS+" - "+submissionId,JSON.stringify(resultingArray));
return resolve(messageConstants.apiResponses.SUBMISSION_RATING_COMPLETED);
} else {
emailClient.pushMailToEmailService(emailRecipients,messageConstants.apiResponses.SUBMISSION_AUTO_RATING_FAILED+" - "+submissionId,JSON.stringify(resultingArray));
// emailClient.pushMailToEmailService(emailRecipients,messageConstants.apiResponses.SUBMISSION_AUTO_RATING_FAILED+" - "+submissionId,JSON.stringify(resultingArray));
return resolve(messageConstants.apiResponses.SUBMISSION_RATING_COMPLETED);
}

} catch (error) {
emailClient.pushMailToEmailService(emailRecipients,messageConstants.apiResponses.SUBMISSION_AUTO_RATING_FAILED+" - "+submissionId,error.message);
// emailClient.pushMailToEmailService(emailRecipients,messageConstants.apiResponses.SUBMISSION_AUTO_RATING_FAILED+" - "+submissionId,error.message);
return reject(error);
}
})
Expand Down Expand Up @@ -936,12 +936,12 @@ module.exports = class SubmissionsHelper {

await this.pushCompletedSubmissionForReporting(submissionId);

emailClient.pushMailToEmailService(emailRecipients,"Successfully marked submission " + submissionId + "complete and pushed for reporting","NO TEXT AVAILABLE");
// emailClient.pushMailToEmailService(emailRecipients,"Successfully marked submission " + submissionId + "complete and pushed for reporting","NO TEXT AVAILABLE");
return resolve(messageConstants.apiResponses.SUBMISSION_RATING_COMPLETED);


} catch (error) {
emailClient.pushMailToEmailService(emailRecipients,messageConstants.apiResponses.SUBMISSION_AUTO_RATING_FAILED+" - "+submissionId,error.message);
// emailClient.pushMailToEmailService(emailRecipients,messageConstants.apiResponses.SUBMISSION_AUTO_RATING_FAILED+" - "+submissionId,error.message);
return reject(error);
}
})
Expand Down

0 comments on commit 58ee2c7

Please sign in to comment.