improve email notification copy; add different copy for daily email
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user