From 9f94440cdcc90fd36a295af0107511584f21bcba Mon Sep 17 00:00:00 2001 From: Bohung Date: Thu, 7 Oct 2021 18:49:21 +0800 Subject: [PATCH] Fix unsubscriber get mail bug. --- lib/tasks/e_paper_tasks.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/e_paper_tasks.rake b/lib/tasks/e_paper_tasks.rake index e209118..868d33a 100644 --- a/lib/tasks/e_paper_tasks.rake +++ b/lib/tasks/e_paper_tasks.rake @@ -12,7 +12,7 @@ namespace :epaper do domain = args[:domain] if !paper.nil? email_format = /^[A-Za-z0-9+_.-]+@[A-Za-z0-9.-]+$/ - subscribers = EPaperSubscriber.where(:language.in=>paper.language_to_send,:email.nin=>['',nil]) + subscribers = EPaperSubscriber.where(:language.in=>paper.language_to_send,:email.nin=>['',nil],:subscribed.ne=>false) subscribers.update_all(:last_paper_sent => paper.id.to_s) emails = subscribers.collect(&:email) site = Site.first