diff --git a/generics/helpers/emailCommunications.js b/generics/helpers/emailCommunications.js index 465daeb1..f7ea5911 100644 --- a/generics/helpers/emailCommunications.js +++ b/generics/helpers/emailCommunications.js @@ -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'); diff --git a/module/observationSubmissions/helper.js b/module/observationSubmissions/helper.js index 6a99e32e..709e54bf 100644 --- a/module/observationSubmissions/helper.js +++ b/module/observationSubmissions/helper.js @@ -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( { @@ -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); } @@ -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); } }) @@ -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); } }) diff --git a/module/submissions/helper.js b/module/submissions/helper.js index 39a8c215..d0f378a4 100644 --- a/module/submissions/helper.js +++ b/module/submissions/helper.js @@ -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); } }) @@ -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); } })