Merge branch 'prevent-sending-emails-to-unsubscribed-users' into 'master'
check if user is subscribed before sending email See merge request saburly/marketalarm/web!69
This commit was merged in pull request #69.
This commit is contained in:
@@ -36,8 +36,8 @@ const notifyMatches = async (matches, dailyNotification = false) => {
|
||||
const asyncSendEmailActions = [];
|
||||
for (const id of searchRequestsToNotify) {
|
||||
const { searchRequest, notifyNow } = matches[id];
|
||||
if (notifyNow) {
|
||||
const { email } = searchRequest;
|
||||
const { email, subscribed } = searchRequest;
|
||||
if (notifyNow && subscribed) {
|
||||
const allMatchingRealEstates = matches[id].realEstates || [];
|
||||
if (allMatchingRealEstates.length > 0) {
|
||||
const emailContent = generateNotificationEmail(
|
||||
|
||||
Reference in New Issue
Block a user