diff --git a/app/helpers/emailContentGenerator.js b/app/helpers/emailContentGenerator.js index d201e8f..a233ff2 100644 --- a/app/helpers/emailContentGenerator.js +++ b/app/helpers/emailContentGenerator.js @@ -34,6 +34,11 @@ const generateNotificationEmail = ( noAllRealEstates, dailyNotification = false ) => { + //DEBUGGING + console.log( + "[DEBUGGING] Function generateNotificationEmail-noAllRealEstates:", + noAllRealEstates + ); const truncateList = realEstates.length > MAX_REAL_ESTATES_IN_EMAIL; const realEstatesToShow = truncateList @@ -60,7 +65,8 @@ const generateNotificationEmail = ( : "U posljednja 24h objavljena je sljedeća nekretnina koja odgovara uslovima Vaše pretrage"; const messageBody = dailyNotification ? dailyMessageBody : asapMessageBody; - + //DEBUGGING + console.log("[DEBUGGING]: Function generateNotificationEmail-", stagingTag); return `

${stagingTag}Zdravo

${messageBody}

@@ -120,6 +126,12 @@ const generateNewSearchRequestEmail = (searchRequest, matchingRealEstates) => { const emailFooter = generateEmailFooter(id, emailFrequencyTitle); + //DEBUGGING + console.log( + "[DEBUGGING]: Function generateNewSearchRequestEmail-", + stagingTag + ); + return `

${stagingTag}Zdravo

Naručili ste da Vam javimo ako se nekretnina sa navedenim uslovima pojavi u oglasima:

@@ -136,6 +148,9 @@ const generateNewSearchRequestEmail = (searchRequest, matchingRealEstates) => { }; const generateEmailSubject = (numberOfRealEstates, singleRealEstateTitle) => { + //DEBUGGING + console.log("[DEBUGGING]: Function generateEmailSubject-", stagingTag); + if (numberOfRealEstates === 1) { return `${stagingTag}Kivi: ${singleRealEstateTitle}`; } diff --git a/app/services/notificationService.js b/app/services/notificationService.js index 6eaa1a4..591ec71 100644 --- a/app/services/notificationService.js +++ b/app/services/notificationService.js @@ -35,9 +35,11 @@ const notifyForNewSearchRequest = async searchRequest => { matchingRealEstates ); const { email } = searchRequest; + //DEBUGGING + console.log("[DEBUGGING]: Function notifyForNewSearchRequest-", stagingTag); await sendEmail( email, - `${stagingTag} Kivi - novi zahtjev za pretragu`, + `${stagingTag} Kivi - novi zahtstagingjev za pretragu`, emailContent ); }; @@ -57,6 +59,11 @@ const notifyMatches = async (matches, dailyNotification = false) => { //New variable allRealEstates are all real estates that exists in db for search req const allRealEstates = await findRealEstatesForSearchRequest(id); const noAllRealEstates = allRealEstates.length; + //DEBUGGING + console.log( + "[DEBUGGING] Function notifyMatches-noAllRealEstates:", + noAllRealEstates + ); if (allMatchingRealEstates.length > 0) { const emailContent = generateNotificationEmail(