Fix unsubscriber get mail bug.

This commit is contained in:
BoHung Chiu 2021-10-07 18:49:21 +08:00
parent 8c6a48acb0
commit 9f94440cdc
1 changed files with 1 additions and 1 deletions

View File

@ -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