improve email notification copy; add different copy for daily email

This commit is contained in:
Bilal Catic
2019-11-04 14:28:11 +01:00
parent 2be013de1f
commit 4d5571b1d8
2 changed files with 21 additions and 5 deletions

View File

@@ -30,7 +30,7 @@ const notifyForNewSearchRequest = async searchRequest => {
await sendEmail(email, "Kivi - novi zahtjev za pretragu", emailContent);
};
const notifyMatches = async matches => {
const notifyMatches = async (matches, dailyNotification = false) => {
const searchRequestsToNotify = Object.keys(matches);
const asyncSendEmailActions = [];
@@ -42,7 +42,8 @@ const notifyMatches = async matches => {
if (allMatchingRealEstates.length > 0) {
const emailContent = generateNotificationEmail(
allMatchingRealEstates,
id
id,
dailyNotification
);
const emailSubject = generateEmailSubject(
allMatchingRealEstates.length,
@@ -105,7 +106,7 @@ const notifyRequestsWithDailyOption = async () => {
searchRequestMatch.save();
}
await notifyMatches(matches);
await notifyMatches(matches, true);
};
module.exports = {