Debugging- noOfRealEstates and staging tag.
This commit is contained in:
@@ -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 `<h3>${stagingTag}Zdravo</h3>
|
||||
<h4>${messageBody}</h4>
|
||||
<div>
|
||||
@@ -120,6 +126,12 @@ const generateNewSearchRequestEmail = (searchRequest, matchingRealEstates) => {
|
||||
|
||||
const emailFooter = generateEmailFooter(id, emailFrequencyTitle);
|
||||
|
||||
//DEBUGGING
|
||||
console.log(
|
||||
"[DEBUGGING]: Function generateNewSearchRequestEmail-",
|
||||
stagingTag
|
||||
);
|
||||
|
||||
return `<h3>${stagingTag}Zdravo</h3>
|
||||
<div>Naručili ste da Vam javimo ako se nekretnina sa navedenim uslovima pojavi u oglasima:</div>
|
||||
<br/>
|
||||
@@ -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}`;
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user